Go to the documentation of this file.
26 #ifndef MXNET_CPP_OPERATOR_H_
27 #define MXNET_CPP_OPERATOR_H_
48 explicit Operator(
const std::string& operator_name);
58 std::string value_str;
63 params_[name] = value_str;
74 std::string value_str;
79 params_[arg_names_[pos]] = value_str;
95 input_symbols_.push_back(symbol.
GetHandle());
110 input_symbols_.push_back(symbol.
GetHandle());
119 for (
auto& s : symbols) {
120 input_symbols_.push_back(s.GetHandle());
144 input_ndarrays_.push_back(ndarray.
GetHandle());
150 template <
class T,
class... Args,
int N = 0>
159 template <
class T,
int N = 0>
170 input_ndarrays_.push_back(ndarray.
GetHandle());
179 for (
auto& s : ndarrays) {
180 input_ndarrays_.push_back(s.GetHandle());
188 template <
typename... Args>
193 std::vector<NDArray>
Invoke();
195 void Invoke(std::vector<NDArray>& outputs);
198 std::map<std::string, std::string> params_desc_;
199 bool variable_params_ =
false;
200 std::map<std::string, std::string> params_;
201 std::vector<SymbolHandle> input_symbols_;
202 std::vector<NDArrayHandle> input_ndarrays_;
203 std::vector<std::string> input_keys_;
204 std::vector<std::string> arg_names_;
206 static OpMap*& op_map();
211 #endif // MXNET_CPP_OPERATOR_H_
namespace of mxnet
Definition: api_registry.h:33
Operator & SetInput(const std::string &name, const Symbol &symbol)
add an input symbol
void PushInput(const Symbol &symbol)
add an input symbol
Definition: operator.h:94
Operator & SetParam(int pos, const T &value)
set config parameters from positional inputs
Definition: operator.h:73
Operator & PushInput(const T &t, Args... args)
add positional inputs
Definition: operator.h:151
Operator & operator=(const Operator &rhs)
Operator & operator()(const std::vector< Symbol > &symbols)
add a list of input symbols
Definition: operator.h:118
Operator interface.
Definition: operator.h:42
NDArray interface.
Definition: ndarray.h:122
Operator & PushInput(const T &t)
add the last positional input
Definition: operator.h:160
Operator & operator()(const std::vector< NDArray > &ndarrays)
add a list of input ndarrays
Definition: operator.h:178
OpMap instance holds a map of all the symbol creators so we can get symbol creators by name....
Definition: op_map.h:42
std::vector< NDArray > Invoke()
Operator & SetParam(const std::string &name, const T &value)
set config parameters
Definition: operator.h:57
void * AtomicSymbolCreator
handle to a function that takes param and creates symbol
Definition: c_api.h:78
Symbol CreateSymbol(const std::string &name="")
create a Symbol from the current operator
Operator & operator()(const Symbol &symbol)
add input symbols
Definition: operator.h:109
Operator & operator()(const NDArray &ndarray)
add input ndarrays
Definition: operator.h:169
Operator & operator()(Args... args)
add input ndarrays
Definition: operator.h:189
Operator(const std::string &operator_name)
Operator constructor.
NDArrayHandle GetHandle() const
Definition: ndarray.h:475
SymbolHandle GetHandle() const
Definition: symbol.h:142
base definitions for mxnetcpp
Operator & operator()()
add input symbols
Definition: operator.h:101
Operator & PushInput(const NDArray &ndarray)
add an input ndarray
Definition: operator.h:143
Symbol interface.
Definition: symbol.h:73