27 #ifndef MXNET_CPP_OP_MAP_H_ 28 #define MXNET_CPP_OP_MAP_H_ 33 #include "dmlc/logging.h" 49 mx_uint num_symbol_creators = 0;
54 for (
mx_uint i = 0; i < num_symbol_creators; i++) {
56 const char *description;
58 const char **arg_names;
59 const char **arg_type_infos;
60 const char **arg_descriptions;
61 const char *key_var_num_args;
63 &num_args, &arg_names, &arg_type_infos,
64 &arg_descriptions, &key_var_num_args);
66 symbol_creators_[name] = symbol_creators[i];
70 const char **op_names;
73 for (
nn_uint i = 0; i < num_ops; i++) {
77 op_handles_[op_names[i]] = handle;
88 if (symbol_creators_.count(name) == 0)
90 return symbol_creators_[name];
100 return op_handles_[name];
104 std::map<std::string, AtomicSymbolCreator> symbol_creators_;
105 std::map<std::string, OpHandle> op_handles_;
111 #endif // MXNET_CPP_OP_MAP_H_ OpHandle GetOpHandle(const std::string &name)
Get an op handle with its name.
Definition: op_map.h:99
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 * AtomicSymbolCreator
handle to a function that takes param and creates symbol
Definition: c_api.h:71
OpMap()
Create an Mxnet instance.
Definition: op_map.h:48
MXNET_DLL int MXSymbolGetAtomicSymbolInfo(AtomicSymbolCreator creator, const char **name, const char **description, uint32_t *num_args, const char ***arg_names, const char ***arg_type_infos, const char ***arg_descriptions, const char **key_var_num_args, const char **return_type DEFAULT(NULL))
Get the detailed information about atomic symbol.
NNVM_DLL int NNListAllOpNames(nn_uint *out_size, const char ***out_array)
list all the available operator names, include entries.
NNVM_DLL int NNGetOpHandle(const char *op_name, OpHandle *op_out)
Get operator handle given name.
unsigned int nn_uint
manually define unsigned int
Definition: c_api.h:42
MXNET_DLL int MXSymbolListAtomicSymbolCreators(uint32_t *out_size, AtomicSymbolCreator **out_array)
list all the available AtomicSymbolEntry
AtomicSymbolCreator GetSymbolCreator(const std::string &name)
Get a symbol creator with its name.
Definition: op_map.h:87
void * OpHandle
handle to a function that takes param and creates symbol
Definition: c_api.h:45
uint32_t mx_uint
manually define unsigned int
Definition: c_api.h:58