27 #ifndef MXNET_CPP_OPERATOR_H_ 28 #define MXNET_CPP_OPERATOR_H_ 49 explicit Operator(
const std::string &operator_name);
59 std::string value_str;
64 params_[name] = value_str;
75 std::string value_str;
80 params_[arg_names_[pos]] = value_str;
96 input_symbols_.push_back(symbol.
GetHandle());
109 input_symbols_.push_back(symbol.
GetHandle());
118 for (
auto &s : symbols) {
119 input_symbols_.push_back(s.GetHandle());
143 input_ndarrays_.push_back(ndarray.
GetHandle());
149 template <
class T,
class... Args,
int N = 0>
158 template <
class T,
int N = 0>
169 input_ndarrays_.push_back(ndarray.
GetHandle());
178 for (
auto &s : ndarrays) {
179 input_ndarrays_.push_back(s.GetHandle());
187 template <
typename... Args>
192 std::vector<NDArray>
Invoke();
194 void Invoke(std::vector<NDArray> &outputs);
197 std::map<std::string, std::string> params_desc_;
198 bool variable_params_ =
false;
199 std::map<std::string, std::string> params_;
200 std::vector<SymbolHandle> input_symbols_;
201 std::vector<NDArrayHandle> input_ndarrays_;
202 std::vector<std::string> input_keys_;
203 std::vector<std::string> arg_names_;
205 static OpMap*& op_map();
210 #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:43
namespace of mxnet
Definition: base.h:89
void PushInput(const Symbol &symbol)
add an input symbol
Definition: operator.h:95
Operator & operator()(const Symbol &symbol)
add input symbols
Definition: operator.h:108
Operator & SetInput(const std::string &name, const Symbol &symbol)
add an input symbol
Operator(const std::string &operator_name)
Operator constructor.
Operator & operator()(Args...args)
add input ndarrays
Definition: operator.h:188
NDArray interface.
Definition: ndarray.h:121
Operator & operator()(const std::vector< NDArray > &ndarrays)
add a list of input ndarrays
Definition: operator.h:177
Operator & PushInput(const NDArray &ndarray)
add an input ndarray
Definition: operator.h:142
Symbol CreateSymbol(const std::string &name="")
create a Symbol from the current operator
NDArrayHandle GetHandle() const
Definition: ndarray.h:475
Operator & operator()(const NDArray &ndarray)
add input ndarrays
Definition: operator.h:168
Operator & SetParam(int pos, const T &value)
set config parameters from positional inputs
Definition: operator.h:74
Operator & operator=(const Operator &rhs)
Operator & operator()(const std::vector< Symbol > &symbols)
add a list of input symbols
Definition: operator.h:117
Operator & SetParam(const std::string &name, const T &value)
set config parameters
Definition: operator.h:58
Operator & PushInput(const T &t, Args...args)
add positional inputs
Definition: operator.h:150
Operator & PushInput(const T &t)
add the last positional input
Definition: operator.h:159
Operator & operator()()
add input symbols
Definition: operator.h:102
void * AtomicSymbolCreator
handle to a function that takes param and creates symbol
Definition: c_api.h:71
SymbolHandle GetHandle() const
Definition: symbol.h:141
std::vector< NDArray > Invoke()
Operator interface.
Definition: operator.h:43
Symbol interface.
Definition: symbol.h:72