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());
108 input_symbols_.push_back(symbol.
GetHandle());
117 for (
auto &s : symbols) {
118 input_symbols_.push_back(s.GetHandle());
142 input_ndarrays_.push_back(ndarray.
GetHandle());
148 template <
class T,
class... Args,
int N = 0>
157 template <
class T,
int N = 0>
168 input_ndarrays_.push_back(ndarray.
GetHandle());
177 for (
auto &s : ndarrays) {
178 input_ndarrays_.push_back(s.GetHandle());
186 template <
typename... Args>
191 std::vector<NDArray>
Invoke();
193 void Invoke(std::vector<NDArray> &outputs);
196 std::map<std::string, std::string> params_desc_;
197 bool variable_params_ =
false;
198 std::map<std::string, std::string> params_;
199 std::vector<SymbolHandle> input_symbols_;
200 std::vector<NDArrayHandle> input_ndarrays_;
201 std::vector<std::string> input_keys_;
202 std::vector<std::string> arg_names_;
204 static OpMap*& op_map();
209 #endif // MXNET_CPP_OPERATOR_H_ OpMap instance holds a map of all the symbol creators so we can get symbol creators by name...
Definition: op_map.h:42
namespace of mxnet
Definition: base.h:126
Operator & SetInput(const std::string &name, Symbol symbol)
add an input symbol
void PushInput(const Symbol &symbol)
add an input symbol
Definition: operator.h:94
Operator & operator()(const Symbol &symbol)
add input symbols
Definition: operator.h:107
Operator(const std::string &operator_name)
Operator constructor.
Operator & operator()(Args...args)
add input ndarrays
Definition: operator.h:187
NDArray interface.
Definition: ndarray.h:120
Operator & operator()(const std::vector< NDArray > &ndarrays)
add a list of input ndarrays
Definition: operator.h:176
Operator & PushInput(const NDArray &ndarray)
add an input ndarray
Definition: operator.h:141
Symbol CreateSymbol(const std::string &name="")
create a Symbol from the current operator
NDArrayHandle GetHandle() const
Definition: ndarray.h:439
Operator & operator()(const NDArray &ndarray)
add input ndarrays
Definition: operator.h:167
Operator & SetParam(int pos, const T &value)
set config parameters from positional inputs
Definition: operator.h:73
Operator & operator=(const Operator &rhs)
Operator & operator()(const std::vector< Symbol > &symbols)
add a list of input symbols
Definition: operator.h:116
Operator & SetParam(const std::string &name, const T &value)
set config parameters
Definition: operator.h:57
Operator & PushInput(const T &t, Args...args)
add positional inputs
Definition: operator.h:149
Operator & PushInput(const T &t)
add the last positional input
Definition: operator.h:158
Operator & operator()()
add input symbols
Definition: operator.h:101
void * AtomicSymbolCreator
handle to a function that takes param and creates symbol
Definition: c_api.h:68
SymbolHandle GetHandle() const
Definition: symbol.h:140
std::vector< NDArray > Invoke()
Operator interface.
Definition: operator.h:42
Symbol interface.
Definition: symbol.h:71