Go to the documentation of this file.
26 #ifndef MXNET_CPP_OP_MAP_H_
27 #define MXNET_CPP_OP_MAP_H_
32 #include "dmlc/logging.h"
48 mx_uint num_symbol_creators = 0;
52 for (
mx_uint i = 0; i < num_symbol_creators; i++) {
54 const char* description;
56 const char** arg_names;
57 const char** arg_type_infos;
58 const char** arg_descriptions;
59 const char* key_var_num_args;
69 symbol_creators_[name] = symbol_creators[i];
73 const char** op_names;
76 for (
nn_uint i = 0; i < num_ops; i++) {
80 op_handles_[op_names[i]] = handle;
91 if (symbol_creators_.count(name) == 0)
93 return symbol_creators_[name];
103 return op_handles_[name];
107 std::map<std::string, AtomicSymbolCreator> symbol_creators_;
108 std::map<std::string, OpHandle> op_handles_;
114 #endif // MXNET_CPP_OP_MAP_H_
namespace of mxnet
Definition: api_registry.h:33
void * OpHandle
handle to a function that takes param and creates symbol
Definition: c_api.h:44
OpMap()
Create an Mxnet instance.
Definition: op_map.h:47
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.
MXNET_DLL int MXSymbolListAtomicSymbolCreators(uint32_t *out_size, AtomicSymbolCreator **out_array)
list all the available AtomicSymbolEntry
NNVM_DLL int NNListAllOpNames(nn_uint *out_size, const char ***out_array)
list all the available operator names, include entries.
unsigned int nn_uint
manually define unsigned int
Definition: c_api.h:41
OpMap instance holds a map of all the symbol creators so we can get symbol creators by name....
Definition: op_map.h:42
OpHandle GetOpHandle(const std::string &name)
Get an op handle with its name.
Definition: op_map.h:102
NNVM_DLL int NNGetOpHandle(const char *op_name, OpHandle *op_out)
Get operator handle given name.
void * AtomicSymbolCreator
handle to a function that takes param and creates symbol
Definition: c_api.h:78
AtomicSymbolCreator GetSymbolCreator(const std::string &name)
Get a symbol creator with its name.
Definition: op_map.h:90
base definitions for mxnetcpp
uint32_t mx_uint
manually define unsigned int
Definition: c_api.h:65