25 #ifndef MXNET_C_API_H_    26 #define MXNET_C_API_H_    35 #define DEFAULT(x) = x    49 #define MXNET_DLL __declspec(dllexport)    51 #define MXNET_DLL __declspec(dllimport)   116   void (*
forward)(int, 
float**, 
int*, 
unsigned**, 
int*, 
void*);
   117   void (*
backward)(int, 
float**, 
int*, 
unsigned**, 
int*, 
void*);
   135   bool (*declare_backward_dependency)(
const int*, 
const int*, 
const int*,
   150   int (**callbacks)(void);
   175                               const int* , 
const int ,
   180                                       unsigned** , 
void* );
   191                                   unsigned** , 
const int* ,
   195                                    const char** , 
const char** ,
   205                                      const int* , 
const int ,
   255                                          const char* 
const* vals,
   256                                          KVStoreHandle kvstoreHandle);
   279                                         KVStoreHandle kvStoreHandle);
   352                                   const char *task_name,
   363                                    const char *frame_name,
   382                                      const char *counter_name,
   430                                  const char *instant_marker_name,
   548                                       const mx_uint *shape,
   557                                       const mx_uint *aux_shape,
   579                                     const char **out_buf);
   603                             NDArrayHandle** out_arr,
   604                             mx_uint *out_name_size,
   605                             const char*** out_names);
   624                             NDArrayHandle** out_arr,
   625                             mx_uint *out_name_size,
   626                             const char*** out_names);
   664                                            const NDArrayHandle handle_src,
   727                                       int *out_storage_type);
   764                                 const mx_uint **out_pdata);
   783                                        DLManagedTensorHandle *out_dlpack);
   799                                   NDArrayHandle *out_handle);
   890                               FunctionHandle **out_array);
   898                             FunctionHandle *out);
   913                             const char **description,
   915                             const char ***arg_names,
   916                             const char ***arg_type_infos,
   917                             const char ***arg_descriptions,
   918                             const char **return_type 
DEFAULT(NULL));
   930                              mx_uint *num_use_vars,
   931                              mx_uint *num_scalars,
   932                              mx_uint *num_mutate_vars,
   945                            NDArrayHandle *use_vars,
   946                            mx_float *scalar_args,
   947                            NDArrayHandle *mutate_vars);
   962                              NDArrayHandle *use_vars,
   963                              mx_float *scalar_args,
   964                              NDArrayHandle *mutate_vars,
   982                                  NDArrayHandle *inputs,
   984                                  NDArrayHandle **outputs,
   986                                  const char **param_keys,
   987                                  const char **param_vals);
  1003                                    NDArrayHandle *inputs,
  1005                                    NDArrayHandle **outputs,
  1007                                    const char **param_keys,
  1008                                    const char **param_vals,
  1009                                    const int **out_stypes);
  1043                                       NDArrayHandle *var_handles,
  1044                                       mx_uint *reqs_array,
  1045                                       NDArrayHandle *grad_handles);
  1053                                         NDArrayHandle* output_handles);
  1063                                  NDArrayHandle* output_handles,
  1064                                  NDArrayHandle* ograd_handles,
  1078                                    NDArrayHandle *output_handles,
  1079                                    NDArrayHandle *ograd_handles,
  1080                                    mx_uint num_variables,
  1081                                    NDArrayHandle *var_handles,
  1085                                    NDArrayHandle **grad_handles,
  1104                                  CachedOpHandle *out);
  1114                                NDArrayHandle *inputs,
  1116                                NDArrayHandle **outputs);
  1129                                  NDArrayHandle *inputs,
  1131                                  NDArrayHandle **outputs,
  1132                                  const int** out_stypes);
  1144                                const char ***out_array);
  1152                                                AtomicSymbolCreator **out_array);
  1202                                           const char **description,
  1204                                           const char ***arg_names,
  1205                                           const char ***arg_type_infos,
  1206                                           const char ***arg_descriptions,
  1207                                           const char **key_var_num_args,
  1208                                           const char **return_type 
DEFAULT(NULL));
  1238                                   SymbolHandle *symbols,
  1358                                     const char ***out_str_array);
  1368                                   const char ***out_str_array);
  1377                                      mx_uint *output_count);
  1415                                           const char ***out_str_array);
  1434                               SymbolHandle* args);
  1473                                  const mx_uint *arg_ind_ptr,
  1474                                  const mx_uint *arg_shape_data,
  1475                                  mx_uint *in_shape_size,
  1476                                  const mx_uint **in_shape_ndim,
  1477                                  const mx_uint ***in_shape_data,
  1478                                  mx_uint *out_shape_size,
  1479                                  const mx_uint **out_shape_ndim,
  1480                                  const mx_uint ***out_shape_data,
  1481                                  mx_uint *aux_shape_size,
  1482                                  const mx_uint **aux_shape_ndim,
  1483                                  const mx_uint ***aux_shape_data,
  1512                                         const mx_uint *arg_ind_ptr,
  1513                                         const mx_uint *arg_shape_data,
  1514                                         mx_uint *in_shape_size,
  1515                                         const mx_uint **in_shape_ndim,
  1516                                         const mx_uint ***in_shape_data,
  1517                                         mx_uint *out_shape_size,
  1518                                         const mx_uint **out_shape_ndim,
  1519                                         const mx_uint ***out_shape_data,
  1520                                         mx_uint *aux_shape_size,
  1521                                         const mx_uint **aux_shape_ndim,
  1522                                         const mx_uint ***aux_shape_data,
  1546                                 const int *arg_type_data,
  1547                                 mx_uint *in_type_size,
  1548                                 const int **in_type_data,
  1549                                 mx_uint *out_type_size,
  1550                                 const int **out_type_data,
  1551                                 mx_uint *aux_type_size,
  1552                                 const int **aux_type_data,
  1567                                const mx_uint num_excluded_symbols,
  1568                                const char **excluded_symbols,
  1569                                const mx_uint num_offline, 
const char **offline_params,
  1570                                const char *quantized_dtype, 
const bool calib_quantize);
  1582                                                const mx_uint num_layers,
  1583                                                const char** layer_names,
  1584                                                const float* low_quantiles,
  1585                                                const float* high_quantiles,
  1586                                                SymbolHandle* ret_sym_handle);
  1595                                    SymbolHandle *ret_sym_handle);
  1632                                  NDArrayHandle *head_grads);
  1645                                    NDArrayHandle *head_grads,
  1657                                 NDArrayHandle **out);
  1678                              NDArrayHandle *in_args,
  1679                              NDArrayHandle *arg_grad_store,
  1680                              mx_uint *grad_req_type,
  1681                              mx_uint aux_states_len,
  1682                              NDArrayHandle *aux_states,
  1683                              ExecutorHandle *out);
  1708                               mx_uint num_map_keys,
  1709                               const char** map_keys,
  1710                               const int* map_dev_types,
  1711                               const int* map_dev_ids,
  1713                               NDArrayHandle *in_args,
  1714                               NDArrayHandle *arg_grad_store,
  1715                               mx_uint *grad_req_type,
  1716                               mx_uint aux_states_len,
  1717                               NDArrayHandle *aux_states,
  1718                               ExecutorHandle *out);
  1744                                mx_uint num_map_keys,
  1745                                const char** map_keys,
  1746                                const int* map_dev_types,
  1747                                const int* map_dev_ids,
  1749                                NDArrayHandle *in_args,
  1750                                NDArrayHandle *arg_grad_store,
  1751                                mx_uint *grad_req_type,
  1752                                mx_uint aux_states_len,
  1753                                NDArrayHandle *aux_states,
  1754                                ExecutorHandle shared_exec,
  1755                                ExecutorHandle *out);
  1760                                    const mx_uint num_g2c_keys,
  1761                                    const char** g2c_keys,
  1762                                    const int* g2c_dev_types,
  1763                                    const int* g2c_dev_ids,
  1764                                    const mx_uint provided_grad_req_list_len,
  1765                                    const char** provided_grad_req_names,
  1766                                    const char** provided_grad_req_types,
  1767                                    const mx_uint num_provided_arg_shapes,
  1768                                    const char** provided_arg_shape_names,
  1769                                    const mx_uint* provided_arg_shape_data,
  1770                                    const mx_uint* provided_arg_shape_idx,
  1771                                    const mx_uint num_provided_arg_dtypes,
  1772                                    const char** provided_arg_dtype_names,
  1773                                    const int* provided_arg_dtypes,
  1774                                    const mx_uint num_provided_arg_stypes,
  1775                                    const char** provided_arg_stype_names,
  1776                                    const int* provided_arg_stypes,
  1777                                    const mx_uint num_shared_arg_names,
  1778                                    const char** shared_arg_name_list,
  1779                                    int* shared_buffer_len,
  1780                                    const char** shared_buffer_name_list,
  1781                                    NDArrayHandle* shared_buffer_handle_list,
  1782                                    const char*** updated_shared_buffer_name_list,
  1783                                    NDArrayHandle** updated_shared_buffer_handle_list,
  1784                                    mx_uint* num_in_args,
  1785                                    NDArrayHandle** in_args,
  1786                                    NDArrayHandle** arg_grads,
  1787                                    mx_uint* num_aux_states,
  1788                                    NDArrayHandle** aux_states,
  1789                                    ExecutorHandle shared_exec_handle,
  1790                                    ExecutorHandle* out);
  1814                                 int allow_up_sizing,
  1817                                 mx_uint num_map_keys,
  1818                                 const char** map_keys,
  1819                                 const int* map_dev_types,
  1820                                 const int* map_dev_ids,
  1821                                 const mx_uint num_provided_arg_shapes,
  1822                                 const char** provided_arg_shape_names,
  1823                                 const mx_uint* provided_arg_shape_data,
  1824                                 const mx_uint* provided_arg_shape_idx,
  1825                                 mx_uint* num_in_args,
  1826                                 NDArrayHandle** in_args,
  1827                                 NDArrayHandle** arg_grads,
  1828                                 mx_uint* num_aux_states,
  1829                                 NDArrayHandle** aux_states,
  1830                                 ExecutorHandle shared_exec,
  1831                                 ExecutorHandle *out);
  1844                                            void* callback_handle);
  1855                               DataIterCreator **out_array);
  1870                                    DataIterHandle *out);
  1884                                     const char **description,
  1886                                     const char ***arg_names,
  1887                                     const char ***arg_type_infos,
  1888                                     const char ***arg_descriptions);
  1917                                 NDArrayHandle *out);
  1926                                  uint64_t **out_index,
  1927                                  uint64_t *out_size);
  1944                                  NDArrayHandle *out);
  1966                               KVStoreHandle *out);
  1997                             NDArrayHandle* vals);
  2010                               NDArrayHandle* vals);
  2024                             NDArrayHandle* vals,
  2038                               NDArrayHandle* vals,
  2053                                       NDArrayHandle* vals,
  2055                                       bool ignore_sparse);
  2069                                         NDArrayHandle* vals,
  2071                                         bool ignore_sparse);
  2084                             NDArrayHandle* vals,
  2098                               NDArrayHandle* vals,
  2116                                      NDArrayHandle* vals,
  2117                                      const NDArrayHandle* row_ids,
  2134                                        NDArrayHandle* vals,
  2135                                        const NDArrayHandle* row_ids,
  2148                                 NDArrayHandle local,
  2160                                    NDArrayHandle local,
  2171                                   void *updater_handle);
  2183                                     void *updater_handle);
  2257                                             const int barrier_before_exit);
  2267                                          void *controller_handle);
  2278                                  void *controller_handle);
  2289                                              const char* cmd_body);
  2304                                       const int timeout_sec 
DEFAULT(60));
  2329                                           const char *buf, 
size_t size);
  2362                                         char const **buf, 
size_t *size);
  2384                           char** input_names, 
char** output_names,
  2385                           NDArrayHandle* inputs, NDArrayHandle* outputs,
  2386                           char* kernel, RtcHandle *out);
  2392                         NDArrayHandle* inputs, NDArrayHandle* outputs,
  2419                                      int num_outputs, NDArrayHandle *outputs,
  2431                                     const char** options, 
int num_exports,
  2432                                     const char** exports, CudaModuleHandle *out);
  2449                                     int num_args, 
int* is_ndarray, 
int* is_const,
  2450                                     int* arg_types, CudaKernelHandle *out);
  2470                                   mx_uint grid_dim_x, mx_uint grid_dim_y,
  2471                                   mx_uint grid_dim_z, mx_uint block_dim_x,
  2472                                   mx_uint block_dim_y, mx_uint block_dim_z,
  2473                                   mx_uint shared_mem);
  2492                                            mx_uint ndim, 
int dtype, NDArrayHandle *out);
  2513                                 EngineVarHandle const_vars_handle, 
int num_const_vars,
  2514                                 EngineVarHandle mutable_vars_handle, 
int num_mutable_vars,
  2515                                 EngineFnPropertyHandle prop_handle 
DEFAULT(NULL),
  2536                                EngineVarHandle const_vars_handle, 
int num_const_vars,
  2537                                EngineVarHandle mutable_vars_handle, 
int num_mutable_vars,
  2538                                EngineFnPropertyHandle prop_handle 
DEFAULT(NULL),
  2543 #endif  // __cplusplus  2545 #endif  // MXNET_C_API_H_ MXNET_DLL int MXKVStoreSendCommmandToServers(KVStoreHandle handle, int cmd_id, const char *cmd_body)
Send a command to all server nodes. 
 
int(* CustomFunctionDelFunc)(void *)
Definition: c_api.h:207
 
MXNET_DLL int MXNDArrayDetach(NDArrayHandle handle, NDArrayHandle *out)
detach and ndarray from computation graph by clearing entry_ 
 
MXNET_DLL int MXListAllOpNames(mx_uint *out_size, const char ***out_array)
list all the available operator names, include entries. 
 
MXNET_DLL int MXNDArrayCreateFromSharedMem(int shared_pid, int shared_id, const mx_uint *shape, mx_uint ndim, int dtype, NDArrayHandle *out)
Reconstruct NDArray from shared memory handle. 
 
MXNET_DLL int MXNDArrayGetAuxType(NDArrayHandle handle, mx_uint i, int *out_type)
get the type of the ith aux data in NDArray 
 
MXNET_DLL int MXNDArrayCallDLPackDeleter(DLManagedTensorHandle dlpack)
Delete a dlpack tensor. 
 
MXNET_DLL int MXGetGPUCount(int *out)
Get the number of GPUs. 
 
MXNET_DLL int MXKVStoreSetUpdater(KVStoreHandle handle, MXKVStoreUpdater updater, void *updater_handle)
register a push updater 
 
MXNET_DLL int MXKVStoreBarrier(KVStoreHandle handle)
global barrier among all worker machines 
 
MXNET_DLL int MXSymbolGetNumOutputs(SymbolHandle symbol, mx_uint *output_count)
Get number of outputs of the symbol. 
 
void * DataIterHandle
handle to a DataIterator 
Definition: c_api.h:83
 
MXNET_DLL int MXSymbolListAtomicSymbolCreators(mx_uint *out_size, AtomicSymbolCreator **out_array)
list all the available AtomicSymbolEntry 
 
const void * EngineFnPropertyHandle
handle to Engine FnProperty 
Definition: c_api.h:101
 
MXNET_DLL int MXDataIterCreateIter(DataIterCreator handle, mx_uint num_param, const char **keys, const char **vals, DataIterHandle *out)
Init an iterator, init with parameters the array size of passed in arguments. 
 
MXNET_DLL int MXProfileSetCounter(ProfileHandle counter_handle, uint64_t value)
Set a counter, given its handle. 
 
MXNET_DLL int MXDataIterNext(DataIterHandle handle, int *out)
Move iterator to next position. 
 
MXNET_DLL int MXNDArrayReshape(NDArrayHandle handle, int ndim, int *dims, NDArrayHandle *out)
Reshape the NDArray. 
 
void * p_infer_shape
Definition: c_api.h:140
 
MXNET_DLL int MXAutogradMarkVariables(mx_uint num_var, NDArrayHandle *var_handles, mx_uint *reqs_array, NDArrayHandle *grad_handles)
mark NDArrays as variables to compute gradient for autograd 
 
MXNET_DLL int MXExecutorPrint(ExecutorHandle handle, const char **out_str)
Print the content of execution plan, used for debug. 
 
MXNET_DLL int MXKVStoreRunServer(KVStoreHandle handle, MXKVStoreServerController controller, void *controller_handle)
Run as server (or scheduler) 
 
MXNET_DLL int MXSetProfilerConfig(int num_params, const char *const *keys, const char *const *vals)
Set up configuration of profiler for worker/current process. 
 
void(* list_arguments)(char ***, void *)
Definition: c_api.h:120
 
MXNET_DLL int MXSymbolSaveToJSON(SymbolHandle symbol, const char **out_json)
Save a symbol into a json string. 
 
MXNET_DLL int MXSymbolInferShape(SymbolHandle sym, mx_uint num_args, const char **keys, const mx_uint *arg_ind_ptr, const mx_uint *arg_shape_data, mx_uint *in_shape_size, const mx_uint **in_shape_ndim, const mx_uint ***in_shape_data, mx_uint *out_shape_size, const mx_uint **out_shape_ndim, const mx_uint ***out_shape_data, mx_uint *aux_shape_size, const mx_uint **aux_shape_ndim, const mx_uint ***aux_shape_data, int *complete)
infer shape of unknown input shapes given the known one. The shapes are packed into a CSR matrix repr...
 
MXNET_DLL int MXSymbolGetAttr(SymbolHandle symbol, const char *key, const char **out, int *success)
Get string attribute from symbol. 
 
MXNET_DLL int MXRtcCreate(char *name, mx_uint num_input, mx_uint num_output, char **input_names, char **output_names, NDArrayHandle *inputs, NDArrayHandle *outputs, char *kernel, RtcHandle *out)
Create a MXRtc object. 
 
MXNET_DLL int MXSymbolGetAtomicSymbolName(AtomicSymbolCreator creator, const char **name)
Get the name of an atomic symbol. 
 
MXNET_DLL int MXExecutorGetOptimizedSymbol(ExecutorHandle handle, SymbolHandle *out)
get optimized graph from graph executor 
 
MXNET_DLL int MXProfileCreateEvent(const char *event_name, ProfileHandle *out)
Create profile event. 
 
MXNET_DLL int MXKVStorePull(KVStoreHandle handle, mx_uint num, const int *keys, NDArrayHandle *vals, int priority)
pull a list of (key, value) pairs from the kvstore 
 
MXNET_DLL int MXNDArrayWaitToRead(NDArrayHandle handle)
Wait until all the pending writes with respect NDArray are finished. Always call this before read dat...
 
MXNET_DLL int MXExecutorBind(SymbolHandle symbol_handle, int dev_type, int dev_id, mx_uint len, NDArrayHandle *in_args, NDArrayHandle *arg_grad_store, mx_uint *grad_req_type, mx_uint aux_states_len, NDArrayHandle *aux_states, ExecutorHandle *out)
Generate Executor from symbol. 
 
void * p_forward
Definition: c_api.h:138
 
MXNET_DLL int MXKVStorePullRowSparse(KVStoreHandle handle, mx_uint num, const int *keys, NDArrayHandle *vals, const NDArrayHandle *row_ids, int priority)
pull a list of (key, value) pairs from the kvstore, where each key is an integer. The NDArray pulled ...
 
MXNET_DLL int MXDumpProfile(int finished)
Save profile and stop profiler for worker/current process. 
 
MXNET_DLL int MXDataIterFree(DataIterHandle handle)
Free the handle to the IO module. 
 
MXNET_DLL int MXKVStoreSetUpdaterEx(KVStoreHandle handle, MXKVStoreUpdater updater, MXKVStoreStrUpdater str_updater, void *updater_handle)
register a push updater with int keys and one with string keys 
 
MXNET_DLL int MXInvokeCachedOp(CachedOpHandle handle, int num_inputs, NDArrayHandle *inputs, int *num_outputs, NDArrayHandle **outputs)
invoke cached operator 
 
MXNET_DLL int MXFreeCachedOp(CachedOpHandle handle)
free cached operator 
 
void * RecordIOHandle
handle to RecordIO 
Definition: c_api.h:87
 
CustomOpCallbacks
Definition: c_api.h:154
 
MXNET_DLL int MXSymbolGetChildren(SymbolHandle symbol, SymbolHandle *out)
Get a symbol that contains only direct children. 
 
MXNET_DLL int MXRecordIOReaderFree(RecordIOHandle handle)
Delete a RecordIO reader object. 
 
MXNET_DLL int MXExecutorOutputs(ExecutorHandle handle, mx_uint *out_size, NDArrayHandle **out)
Get executor's head NDArray. 
 
MXNET_DLL int MXNDArrayGetContext(NDArrayHandle handle, int *out_dev_type, int *out_dev_id)
get the context of the NDArray 
 
MXNET_DLL int MXFuncDescribe(FunctionHandle fun, mx_uint *num_use_vars, mx_uint *num_scalars, mx_uint *num_mutate_vars, int *type_mask)
get the argument requirements of the function 
 
MXNET_DLL int MXProfileCreateTask(ProfileHandle domain, const char *task_name, ProfileHandle *out)
Create profile task. 
 
MXNET_DLL int MXKVStoreIsServerNode(int *ret)
return whether or not this process is a server node. 
 
MXNET_DLL int MXNDArraySlice(NDArrayHandle handle, mx_uint slice_begin, mx_uint slice_end, NDArrayHandle *out)
Slice the NDArray along axis 0. 
 
void * ExecutorHandle
handle to an Executor 
Definition: c_api.h:79
 
CustomFunctionCallbacks
Definition: c_api.h:199
 
MXNET_DLL int MXSymbolSaveToFile(SymbolHandle symbol, const char *fname)
Save a symbol into a json file. 
 
void * AtomicSymbolHandle
handle to a AtomicSymbol 
Definition: c_api.h:77
 
MXNET_DLL int MXGetGPUMemoryInformation64(int dev, uint64_t *free_mem, uint64_t *total_mem)
get the free and total available memory on a GPU 
 
MXNET_DLL int MXProfilePause(int paused)
Pause profiler tuning collection for worker/current process. 
 
void * p_backward
Definition: c_api.h:123
 
MXNET_DLL int MXFuncGetInfo(FunctionHandle fun, const char **name, const char **description, mx_uint *num_args, const char ***arg_names, const char ***arg_type_infos, const char ***arg_descriptions, const char **return_type DEFAULT(NULL))
Get the information of the function handle. 
 
MXNET_DLL int MXAutogradSetIsTraining(int is_training, int *prev)
set whether to record operator for autograd 
 
MXNET_DLL int MXNDArrayFree(NDArrayHandle handle)
free the narray handle 
 
MXNET_DLL int MXSymbolCreateFromJSON(const char *json, SymbolHandle *out)
Load a symbol from a json string. 
 
CustomOpPropCallbacks
Definition: c_api.h:160
 
int(* CustomOpInferTypeFunc)(int, int *, void *)
Definition: c_api.h:186
 
MXNET_DLL int MXKVStoreIsSchedulerNode(int *ret)
return whether or not this process is a scheduler node. 
 
MXNET_DLL int MXInvokeCachedOpEx(CachedOpHandle handle, int num_inputs, NDArrayHandle *inputs, int *num_outputs, NDArrayHandle **outputs, const int **out_stypes)
invoke a cached op 
 
MXNET_DLL int MXSymbolGetAtomicSymbolInfo(AtomicSymbolCreator creator, const char **name, const char **description, mx_uint *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. 
 
#define DEFAULT(x)
Inhibit C++ name-mangling for MXNet functions. 
Definition: c_api.h:37
 
Symbol reverse(const std::string &symbol_name, Symbol data, Shape axis)
Definition: op.h:778
 
MXNET_DLL int MXNDArrayLoadFromBuffer(const void *ndarray_buffer, size_t size, mx_uint *out_size, NDArrayHandle **out_arr, mx_uint *out_name_size, const char ***out_names)
Load list / dictionary of narrays from file content loaded into memory. This will load a list of ndar...
 
MXNET_DLL int MXSetProfilerState(int state)
Set up state of profiler for current process. 
 
MXNET_DLL int MXImperativeInvoke(AtomicSymbolCreator creator, int num_inputs, NDArrayHandle *inputs, int *num_outputs, NDArrayHandle **outputs, int num_params, const char **param_keys, const char **param_vals)
invoke a nnvm op and imperative function 
 
MXNET_DLL int MXProfileDestroyHandle(ProfileHandle frame_handle)
Destroy a frame. 
 
MXNET_DLL int MXNDArrayReshape64(NDArrayHandle handle, int ndim, dim_t *dims, bool reverse, NDArrayHandle *out)
Reshape the NDArray. 
 
MXNET_DLL int MXSymbolListAttr(SymbolHandle symbol, mx_uint *out_size, const char ***out)
Get all attributes from symbol, including all descendents. 
 
MXNET_DLL int MXRtcCudaKernelFree(CudaKernelHandle handle)
 
MXNET_DLL int MXExecutorReshape(int partial_shaping, int allow_up_sizing, int dev_type, int dev_id, mx_uint num_map_keys, const char **map_keys, const int *map_dev_types, const int *map_dev_ids, const mx_uint num_provided_arg_shapes, const char **provided_arg_shape_names, const mx_uint *provided_arg_shape_data, const mx_uint *provided_arg_shape_idx, mx_uint *num_in_args, NDArrayHandle **in_args, NDArrayHandle **arg_grads, mx_uint *num_aux_states, NDArrayHandle **aux_states, ExecutorHandle shared_exec, ExecutorHandle *out)
Return a new executor with the same symbol and shared memory, but different input/output shapes...
 
MXNET_DLL int MXNDArrayAt(NDArrayHandle handle, mx_uint idx, NDArrayHandle *out)
Index the NDArray along axis 0. 
 
MXNET_DLL int MXNDArrayGetAuxNDArray(NDArrayHandle handle, mx_uint i, NDArrayHandle *out)
Get a deep copy of the ith aux data blob in the form of an NDArray of default storage type...
 
MXNET_DLL int MXProfileCreateCounter(ProfileHandle domain, const char *counter_name, ProfileHandle *out)
Create profile counter. 
 
MXNET_DLL int MXNDArrayLoad(const char *fname, mx_uint *out_size, NDArrayHandle **out_arr, mx_uint *out_name_size, const char ***out_names)
Load list of narray from the file. 
 
MXNET_DLL int MXRtcCudaKernelCreate(CudaModuleHandle handle, const char *name, int num_args, int *is_ndarray, int *is_const, int *arg_types, CudaKernelHandle *out)
 
MXNET_DLL int MXNDArraySyncCopyFromCPU(NDArrayHandle handle, const void *data, size_t size)
Perform a synchronize copy from a continugous CPU memory region. 
 
MXNET_DLL int MXSymbolCreateFromFile(const char *fname, SymbolHandle *out)
Load a symbol from a json file. 
 
MXNET_DLL int MXQuantizeSymbol(SymbolHandle sym_handle, SymbolHandle *ret_sym_handle, const mx_uint num_excluded_symbols, const char **excluded_symbols, const mx_uint num_offline, const char **offline_params, const char *quantized_dtype, const bool calib_quantize)
Convert a symbol into a quantized symbol where FP32 operators are replaced with INT8. 
 
MXNET_DLL int MXKVStorePushEx(KVStoreHandle handle, mx_uint num, const char **keys, NDArrayHandle *vals, int priority)
Push a list of (key,value) pairs to kvstore, where each key is a string. 
 
void( MXKVStoreStrUpdater)(const char *key, NDArrayHandle recv, NDArrayHandle local, void *handle)
user-defined updater for the kvstore with string keys It's this updater's responsibility to delete re...
Definition: c_api.h:2158
 
MXNET_DLL int MXNDArrayCreateSparseEx(int storage_type, const mx_uint *shape, mx_uint ndim, int dev_type, int dev_id, int delay_alloc, int dtype, mx_uint num_aux, int *aux_type, mx_uint *aux_ndims, const mx_uint *aux_shape, NDArrayHandle *out)
create an empty sparse NDArray with specified shape and data type 
 
MXNET_DLL int MXExecutorSimpleBind(SymbolHandle symbol_handle, int dev_type, int dev_id, const mx_uint num_g2c_keys, const char **g2c_keys, const int *g2c_dev_types, const int *g2c_dev_ids, const mx_uint provided_grad_req_list_len, const char **provided_grad_req_names, const char **provided_grad_req_types, const mx_uint num_provided_arg_shapes, const char **provided_arg_shape_names, const mx_uint *provided_arg_shape_data, const mx_uint *provided_arg_shape_idx, const mx_uint num_provided_arg_dtypes, const char **provided_arg_dtype_names, const int *provided_arg_dtypes, const mx_uint num_provided_arg_stypes, const char **provided_arg_stype_names, const int *provided_arg_stypes, const mx_uint num_shared_arg_names, const char **shared_arg_name_list, int *shared_buffer_len, const char **shared_buffer_name_list, NDArrayHandle *shared_buffer_handle_list, const char ***updated_shared_buffer_name_list, NDArrayHandle **updated_shared_buffer_handle_list, mx_uint *num_in_args, NDArrayHandle **in_args, NDArrayHandle **arg_grads, mx_uint *num_aux_states, NDArrayHandle **aux_states, ExecutorHandle shared_exec_handle, ExecutorHandle *out)
 
void(* ExecutorMonitorCallback)(const char *, NDArrayHandle, void *)
Definition: c_api.h:111
 
void * p_forward
Definition: c_api.h:122
 
MXNET_DLL int MXNDArrayCreateEx(const mx_uint *shape, mx_uint ndim, int dev_type, int dev_id, int delay_alloc, int dtype, NDArrayHandle *out)
create a NDArray with specified shape and data type 
 
MXNET_DLL int MXEngineSetBulkSize(int bulk_size, int *prev_bulk_size)
set bulk execution limit 
 
int(* CustomOpBackwardInferStorageTypeFunc)(int, int *, int *, void *)
Definition: c_api.h:182
 
void * p_list_arguments
Definition: c_api.h:126
 
MXNET_DLL int MXKVStoreCreate(const char *type, KVStoreHandle *out)
Create a kvstore. 
 
int(* CustomOpDelFunc)(void *)
Definition: c_api.h:177
 
void * p_declare_backward_dependency
Definition: c_api.h:143
 
MXNET_DLL int MXNDArrayCreateNone(NDArrayHandle *out)
create a NDArray handle that is not initialized can be used to pass in as mutate variables to hold th...
 
MXNET_DLL int MXEnginePushSync(EngineSyncFunc sync_func, void *func_param, EngineFuncParamDeleter deleter, ContextHandle ctx_handle, EngineVarHandle const_vars_handle, int num_const_vars, EngineVarHandle mutable_vars_handle, int num_mutable_vars, EngineFnPropertyHandle prop_handle DEFAULT(NULL), int priority DEFAULT(0), const char *opr_name DEFAULT(NULL))
Push a synchronous operation to the engine. 
 
MXNET_DLL int MXGenBackendSubgraph(SymbolHandle sym_handle, const char *backend, SymbolHandle *ret_sym_handle)
Run subgraph pass based on the backend provided. 
 
MXNET_DLL int MXKVStoreFree(KVStoreHandle handle)
Delete a KVStore handle. 
 
void * DLManagedTensorHandle
handle to DLManagedTensor 
Definition: c_api.h:97
 
void * p_list_arguments
Definition: c_api.h:142
 
MXNET_DLL int MXCustomOpRegister(const char *op_type, CustomOpPropCreator creator)
 
MXNET_DLL int MXExecutorBackwardEx(ExecutorHandle handle, mx_uint len, NDArrayHandle *head_grads, int is_train)
Excecutor run backward. 
 
void * SymbolHandle
handle to a symbol that can be bind as operator 
Definition: c_api.h:75
 
MXNET_DLL int MXProfileCreateDomain(const char *domain, ProfileHandle *out)
Create profiling domain. 
 
void * CudaModuleHandle
handle to rtc cuda module 
Definition: c_api.h:91
 
MXNET_DLL int MXSymbolCopy(SymbolHandle symbol, SymbolHandle *out)
Copy the symbol to another handle. 
 
MXNET_DLL int MXGetVersion(int *out)
get the MXNet library version as an integer 
 
int(** callbacks)(void)
Definition: c_api.h:150
 
void * CachedOpHandle
handle to cached operator 
Definition: c_api.h:73
 
MXNET_DLL int MXSymbolSetAttr(SymbolHandle symbol, const char *key, const char *value)
Set string attribute from symbol. NOTE: Setting attribute to a symbol can affect the semantics(mutabl...
 
MXNET_DLL int MXSetNumOMPThreads(int thread_num)
Set the number of OMP threads to use. 
 
MXNET_DLL int MXDumpProcessProfile(int finished, int profile_process, KVStoreHandle kvStoreHandle)
Save profile and stop profiler. 
 
MXNET_DLL int MXDataIterBeforeFirst(DataIterHandle handle)
Call iterator.Reset. 
 
MXNET_DLL int MXSymbolInferShapePartial(SymbolHandle sym, mx_uint num_args, const char **keys, const mx_uint *arg_ind_ptr, const mx_uint *arg_shape_data, mx_uint *in_shape_size, const mx_uint **in_shape_ndim, const mx_uint ***in_shape_data, mx_uint *out_shape_size, const mx_uint **out_shape_ndim, const mx_uint ***out_shape_data, mx_uint *aux_shape_size, const mx_uint **aux_shape_ndim, const mx_uint ***aux_shape_data, int *complete)
partially infer shape of unknown input shapes given the known one. 
 
MXNET_DLL int MXSymbolListOutputs(SymbolHandle symbol, mx_uint *out_size, const char ***out_str_array)
List returns in the symbol. 
 
MXNET_DLL int MXListDataIters(mx_uint *out_size, DataIterCreator **out_array)
List all the available iterator entries. 
 
MXNET_DLL int MXProfileSetMarker(ProfileHandle domain, const char *instant_marker_name, const char *scope)
Mark a single instant in time. 
 
MXNET_DLL int MXNDArrayGetShape(NDArrayHandle handle, mx_uint *out_dim, const mx_uint **out_pdata)
get the shape of the array 
 
MXNET_DLL int MXCreateCachedOpEx(SymbolHandle handle, int num_flags, const char **keys, const char **vals, CachedOpHandle *out)
create cached operator 
 
MXNET_DLL int MXDataIterGetPadNum(DataIterHandle handle, int *pad)
Get the padding number in current data batch. 
 
MXNET_DLL int MXAutogradComputeGradient(mx_uint num_output, NDArrayHandle *output_handles)
compute the gradient of outputs w.r.t variabels 
 
MXNET_DLL int MXNDArrayGetSharedMemHandle(NDArrayHandle handle, int *shared_pid, int *shared_id)
Get shared memory handle from NDArray. 
 
MXNET_DLL int MXFuncInvokeEx(FunctionHandle fun, NDArrayHandle *use_vars, mx_float *scalar_args, NDArrayHandle *mutate_vars, int num_params, char **param_keys, char **param_vals)
invoke a function, the array size of passed in arguments must match the values in the ...
 
MXNET_DLL int MXRtcCudaModuleCreate(const char *source, int num_options, const char **options, int num_exports, const char **exports, CudaModuleHandle *out)
 
int num_callbacks
Definition: c_api.h:149
 
const void * ContextHandle
handle to Context 
Definition: c_api.h:99
 
MXNET_DLL int MXRandomSeed(int seed)
Seed all global random number generators in mxnet. 
 
MXNET_DLL int MXSymbolGetOutput(SymbolHandle symbol, mx_uint index, SymbolHandle *out)
Get index-th outputs of the symbol. 
 
MXNET_DLL int MXNDArrayGetDType(NDArrayHandle handle, int *out_dtype)
get the type of the data in NDArray 
 
MXNET_DLL int MXAutogradIsTraining(bool *curr)
get whether training mode is on 
 
MXNET_DLL int MXAutogradBackwardEx(mx_uint num_output, NDArrayHandle *output_handles, NDArrayHandle *ograd_handles, mx_uint num_variables, NDArrayHandle *var_handles, int retain_graph, int create_graph, int is_train, NDArrayHandle **grad_handles, int **grad_stypes)
compute the gradient of outputs w.r.t variabels 
 
void(* forward)(int, float **, int *, unsigned **, int *, void *)
Definition: c_api.h:116
 
int(* MXGenericCallback)(void)
Definition: c_api.h:146
 
MXNET_DLL int MXSetCalibTableToQuantizedSymbol(SymbolHandle qsym_handle, const mx_uint num_layers, const char **layer_names, const float *low_quantiles, const float *high_quantiles, SymbolHandle *ret_sym_handle)
Set calibration table to node attributes in the sym. 
 
MXNET_DLL int MXSymbolGetInputSymbols(SymbolHandle sym, SymbolHandle **inputs, int *input_size)
Get the input symbols of the graph. 
 
MXNET_DLL int MXSymbolGetInternals(SymbolHandle symbol, SymbolHandle *out)
Get a symbol that contains all the internals. 
 
MXNET_DLL int MXNDArrayGetDataNDArray(NDArrayHandle handle, NDArrayHandle *out)
Get a deep copy of the data blob in the form of an NDArray of default storage type. This function blocks. Do not use it in performance critical code. 
 
MXNET_DLL int MXInitPSEnv(mx_uint num_vars, const char **keys, const char **vals)
Initialized ps-lite environment variables. 
 
MXNET_DLL int MXRandomSeedContext(int seed, int dev_type, int dev_id)
Seed the global random number generator of the given device. 
 
MXNET_DLL int MXDataIterGetData(DataIterHandle handle, NDArrayHandle *out)
Get the handle to the NDArray of underlying data. 
 
MXNET_DLL int MXRtcFree(RtcHandle handle)
Delete a MXRtc object. 
 
MXNET_DLL int MXNDArrayFromDLPack(DLManagedTensorHandle dlpack, NDArrayHandle *out_handle)
Create a NDArray backed by a dlpack tensor. 
 
MXNET_DLL int MXNDArraySyncCopyToCPU(NDArrayHandle handle, void *data, size_t size)
Perform a synchronize copyto a continugous CPU memory region. 
 
MXNET_DLL int MXAutogradSetIsRecording(int is_recording, int *prev)
set whether to record operator for autograd 
 
void( MXKVStoreServerController)(int head, const char *body, void *controller_handle)
the prototype of a server controller 
Definition: c_api.h:2265
 
void * KVStoreHandle
handle to KVStore 
Definition: c_api.h:85
 
void * NDArrayHandle
handle to NDArray 
Definition: c_api.h:67
 
MXNET_DLL int MXNotifyShutdown()
Notify the engine about a shutdown, This can help engine to print less messages into display...
 
void * p_list_outputs
Definition: c_api.h:141
 
MXNET_DLL int MXDataIterGetIndex(DataIterHandle handle, uint64_t **out_index, uint64_t *out_size)
Get the image index by array. 
 
MXNET_DLL int MXDataIterGetLabel(DataIterHandle handle, NDArrayHandle *out)
Get the handle to the NDArray of underlying label. 
 
int(* CustomOpCreateFunc)(const char *, int, unsigned **, const int *, const int *, struct MXCallbackList *, void *)
Definition: c_api.h:190
 
MXNET_DLL int MXEnginePushAsync(EngineAsyncFunc async_func, void *func_param, EngineFuncParamDeleter deleter, ContextHandle ctx_handle, EngineVarHandle const_vars_handle, int num_const_vars, EngineVarHandle mutable_vars_handle, int num_mutable_vars, EngineFnPropertyHandle prop_handle DEFAULT(NULL), int priority DEFAULT(0), const char *opr_name DEFAULT(NULL), bool wait DEFAULT(false))
Push an asynchronous operation to the engine. 
 
int(* CustomOpFBFunc)(int, void **, int *, const int *, const int, void *)
Definition: c_api.h:174
 
MXNET_DLL int MXNDArraySyncCopyFromNDArray(NDArrayHandle handle_dst, const NDArrayHandle handle_src, const int i)
Copy src.data() to dst.data() if i = -1, else dst.aux_data(i) if i >= 0 This function blocks...
 
MXNET_DLL int MXSymbolCreateGroup(mx_uint num_symbols, SymbolHandle *symbols, SymbolHandle *out)
Create a Symbol by grouping list of symbols together. 
 
MXNET_DLL int MXNDArrayCreate(const mx_uint *shape, mx_uint ndim, int dev_type, int dev_id, int delay_alloc, NDArrayHandle *out)
create a NDArray with specified shape 
 
MXNET_DLL int MXKVStoreSetBarrierBeforeExit(KVStoreHandle handle, const int barrier_before_exit)
whether to do barrier when finalize 
 
MXNET_DLL int MXFuncInvoke(FunctionHandle fun, NDArrayHandle *use_vars, mx_float *scalar_args, NDArrayHandle *mutate_vars)
invoke a function, the array size of passed in arguments must match the values in the ...
 
MXNET_DLL int MXSymbolListArguments(SymbolHandle symbol, mx_uint *out_size, const char ***out_str_array)
List arguments in the symbol. 
 
MXNET_DLL int MXNDArrayGetStorageType(NDArrayHandle handle, int *out_storage_type)
get the storage type of the array 
 
MXNET_DLL int MXRecordIOWriterCreate(const char *uri, RecordIOHandle *out)
Create a RecordIO writer object. 
 
void * p_infer_shape
Definition: c_api.h:124
 
MXNET_DLL int MXKVStorePullRowSparseEx(KVStoreHandle handle, mx_uint num, const char **keys, NDArrayHandle *vals, const NDArrayHandle *row_ids, int priority)
pull a list of (key, value) pairs from the kvstore, where each key is a string. The NDArray pulled ba...
 
MXNET_DLL int MXNDArrayWaitAll()
wait until all delayed operations in the system is completed 
 
MXNET_DLL int MXKVStorePullEx(KVStoreHandle handle, mx_uint num, const char **keys, NDArrayHandle *vals, int priority)
pull a list of (key, value) pairs from the kvstore, where each key is a string 
 
MXNET_DLL int MXRecordIOReaderCreate(const char *uri, RecordIOHandle *out)
Create a RecordIO reader object. 
 
MXNET_DLL int MXProfileDurationStop(ProfileHandle duration_handle)
Stop timing the duration of a profile duration object such as an event, task or frame. 
 
MXNET_DLL int MXKVStoreGetNumDeadNode(KVStoreHandle handle, const int node_id, int *number, const int timeout_sec DEFAULT(60))
Get the number of ps dead node(s) specified by {node_id}. 
 
MXNET_DLL int MXProfileAdjustCounter(ProfileHandle counter_handle, int64_t value)
Adjust a counter by the given amount, given its handle. 
 
unsigned int mx_uint
manually define unsigned int 
Definition: c_api.h:58
 
MXNET_DLL int MXAggregateProfileStatsPrint(const char **out_str, int reset)
Print aggregate stats to the a string. 
 
MXNET_DLL int MXRecordIOWriterTell(RecordIOHandle handle, size_t *pos)
Get the current writer pointer position. 
 
MXNET_DLL int MXRecordIOReaderTell(RecordIOHandle handle, size_t *pos)
Get the current writer pointer position. 
 
MXNET_DLL int MXNDArraySaveRawBytes(NDArrayHandle handle, size_t *out_size, const char **out_buf)
save the NDArray into raw bytes. 
 
MXNET_DLL int MXSymbolGetName(SymbolHandle symbol, const char **out, int *success)
Get string name from symbol. 
 
MXNET_DLL int MXKVStoreSetGradientCompression(KVStoreHandle handle, mx_uint num_params, const char **keys, const char **vals)
Set parameters to use low-bit compressed gradients. 
 
void * p_backward
Definition: c_api.h:139
 
MXNET_DLL int MXSymbolCutSubgraph(SymbolHandle sym, SymbolHandle **inputs, int *input_size)
Cut a subgraph whose nodes are marked with a subgraph attribute. The input graph will be modified...
 
MXNET_DLL int MXExecutorBindEX(SymbolHandle symbol_handle, int dev_type, int dev_id, mx_uint num_map_keys, const char **map_keys, const int *map_dev_types, const int *map_dev_ids, mx_uint len, NDArrayHandle *in_args, NDArrayHandle *arg_grad_store, mx_uint *grad_req_type, mx_uint aux_states_len, NDArrayHandle *aux_states, ExecutorHandle shared_exec, ExecutorHandle *out)
Generate Executor from symbol, This is advanced function, allow specify group2ctx map...
 
MXNET_DLL int MXKVStorePullWithSparse(KVStoreHandle handle, mx_uint num, const int *keys, NDArrayHandle *vals, int priority, bool ignore_sparse)
pull a list of (key, value) pairs from the kvstore 
 
void(* EngineSyncFunc)(void *, void *)
Engine synchronous operation. 
Definition: c_api.h:108
 
MXNET_DLL int MXAutogradIsRecording(bool *curr)
get whether autograd recording is on 
 
MXNET_DLL int MXRecordIOWriterFree(RecordIOHandle handle)
Delete a RecordIO writer object. 
 
MXNET_DLL int MXExecutorBackward(ExecutorHandle handle, mx_uint len, NDArrayHandle *head_grads)
Excecutor run backward. 
 
MXNET_DLL int MXKVStoreGetRank(KVStoreHandle handle, int *ret)
return The rank of this node in its group, which is in [0, GroupSize). 
 
MXNET_DLL int MXCustomFunctionRecord(int num_inputs, NDArrayHandle *inputs, int num_outputs, NDArrayHandle *outputs, struct MXCallbackList *callbacks)
 
int64_t dim_t
data type to store dim size 
Definition: c_api.h:62
 
MXNET_DLL int MXKVStoreGetGroupSize(KVStoreHandle handle, int *ret)
return The number of nodes in this group, which is 
 
MXNET_DLL int MXRecordIOWriterWriteRecord(RecordIOHandle handle, const char *buf, size_t size)
Write a record to a RecordIO object. 
 
int(* CustomOpPropCreator)(const char *, const int, const char **, const char **, struct MXCallbackList *)
Definition: c_api.h:194
 
MXNET_DLL int MXSetProcessProfilerState(int state, int profile_process, KVStoreHandle kvStoreHandle)
Set up state of profiler for either worker or server process. 
 
MXNET_DLL int MXSymbolCreateVariable(const char *name, SymbolHandle *out)
Create a Variable Symbol. 
 
MXNET_DLL int MXProfileDurationStart(ProfileHandle duration_handle)
Start timing the duration of a profile duration object such as an event, task or frame. 
 
MXNET_DLL int MXExecutorSetMonitorCallback(ExecutorHandle handle, ExecutorMonitorCallback callback, void *callback_handle)
set a call back to notify the completion of operation 
 
int(* CustomFunctionBwdFunc)(int, int, void **, const int *, const int, void *)
Definition: c_api.h:204
 
MXNET_DLL int MXAutogradBackward(mx_uint num_output, NDArrayHandle *output_handles, NDArrayHandle *ograd_handles, int retain_graph)
compute the gradient of outputs w.r.t variabels 
 
void * CudaKernelHandle
handle to rtc cuda kernel 
Definition: c_api.h:93
 
MXNET_DLL int MXKVStoreIsWorkerNode(int *ret)
return whether or not this process is a worker node. 
 
void(* EngineAsyncFunc)(void *, void *, void *)
Engine asynchronous operation. 
Definition: c_api.h:106
 
MXNET_DLL int MXSymbolPrint(SymbolHandle symbol, const char **out_str)
Print the content of symbol, used for debug. 
 
MXNET_DLL int MXSymbolCompose(SymbolHandle sym, const char *name, mx_uint num_args, const char **keys, SymbolHandle *args)
Compose the symbol on other symbols. 
 
MXNET_DLL int MXSymbolGrad(SymbolHandle sym, mx_uint num_wrt, const char **wrt, SymbolHandle *out)
Get the gradient graph of the symbol. 
 
float mx_float
manually define float 
Definition: c_api.h:60
 
MXNET_DLL int MXNDArrayToDLPack(NDArrayHandle handle, DLManagedTensorHandle *out_dlpack)
Create a reference view of NDArray that represents as DLManagedTensor Notice: MXNet uses asynchronous...
 
MXNET_DLL int MXCreateCachedOp(SymbolHandle handle, CachedOpHandle *out)
create cached operator 
 
MXNET_DLL int MXRecordIOReaderSeek(RecordIOHandle handle, size_t pos)
Set the current reader pointer position. 
 
#define MXNET_DLL
MXNET_DLL prefix for windows. 
Definition: c_api.h:54
 
MXNET_DLL int MXSymbolCreateAtomicSymbol(AtomicSymbolCreator creator, mx_uint num_param, const char **keys, const char **vals, SymbolHandle *out)
Create an AtomicSymbol. 
 
MXNET_DLL int MXNDArraySetGradState(NDArrayHandle handle, int state)
set the flag for gradient array state. 
 
MXNET_DLL int MXNDArraySyncCheckFormat(NDArrayHandle handle, const bool full_check)
check whether the NDArray format is valid 
 
MXNET_DLL int MXProcessProfilePause(int paused, int profile_process, KVStoreHandle kvStoreHandle)
Pause profiler tuning collection. 
 
MXNET_DLL const char * MXGetLastError()
return str message of the last error all function in this file will return 0 when success and -1 when...
 
MXNET_DLL int MXNDArrayGetGradState(NDArrayHandle handle, int *out)
set the flag for gradient array state. 
 
void ** contexts
Definition: c_api.h:151
 
void * AtomicSymbolCreator
handle to a function that takes param and creates symbol 
Definition: c_api.h:71
 
MXNET_DLL int MXKVStoreInitEx(KVStoreHandle handle, mx_uint num, const char **keys, NDArrayHandle *vals)
Init a list of (key,value) pairs in kvstore, where each key is a string. 
 
MXNET_DLL int MXAutogradGetSymbol(NDArrayHandle handle, SymbolHandle *out)
 
MXNET_DLL int MXExecutorBindX(SymbolHandle symbol_handle, int dev_type, int dev_id, mx_uint num_map_keys, const char **map_keys, const int *map_dev_types, const int *map_dev_ids, mx_uint len, NDArrayHandle *in_args, NDArrayHandle *arg_grad_store, mx_uint *grad_req_type, mx_uint aux_states_len, NDArrayHandle *aux_states, ExecutorHandle *out)
Generate Executor from symbol, This is advanced function, allow specify group2ctx map...
 
void(* infer_shape)(int, int *, unsigned **, void *)
Definition: c_api.h:118
 
void * ProfileHandle
handle to a Profile object (domain, duration, counter, etc.) 
Definition: c_api.h:95
 
void * EngineVarHandle
handle to Engine VarHandle 
Definition: c_api.h:103
 
MXNET_DLL int MXKVStorePullWithSparseEx(KVStoreHandle handle, mx_uint num, const char **keys, NDArrayHandle *vals, int priority, bool ignore_sparse)
pull a list of (key, value) pairs from the kvstore, where each key is a string 
 
void * p_list_outputs
Definition: c_api.h:125
 
MXNET_DLL int MXNDArraySave(const char *fname, mx_uint num_args, NDArrayHandle *args, const char **keys)
Save list of narray into the file. 
 
MXNET_DLL int MXNDArrayLoadFromRawBytes(const void *buf, size_t size, NDArrayHandle *out)
create a NDArray handle that is loaded from raw bytes. 
 
MXNET_DLL int MXRtcPush(RtcHandle handle, mx_uint num_input, mx_uint num_output, NDArrayHandle *inputs, NDArrayHandle *outputs, mx_uint gridDimX, mx_uint gridDimY, mx_uint gridDimZ, mx_uint blockDimX, mx_uint blockDimY, mx_uint blockDimZ)
Run cuda kernel. 
 
void( MXKVStoreUpdater)(int key, NDArrayHandle recv, NDArrayHandle local, void *handle)
user-defined updater for the kvstore It's this updater's responsibility to delete recv and local ...
Definition: c_api.h:2146
 
MXNET_DLL int MXSymbolListAuxiliaryStates(SymbolHandle symbol, mx_uint *out_size, const char ***out_str_array)
List auxiliary states in the symbol. 
 
MXNET_DLL int MXGetFunction(const char *name, FunctionHandle *out)
get the function handle by name 
 
MXNET_DLL int MXSymbolListAttrShallow(SymbolHandle symbol, mx_uint *out_size, const char ***out)
Get all attributes from symbol, excluding descendents. 
 
void * DataIterCreator
handle a dataiter creator 
Definition: c_api.h:81
 
void(* EngineFuncParamDeleter)(void *)
Callback to free the param for EngineAsyncFunc/EngineSyncFunc. 
Definition: c_api.h:110
 
MXNET_DLL int MXDataIterGetIterInfo(DataIterCreator creator, const char **name, const char **description, mx_uint *num_args, const char ***arg_names, const char ***arg_type_infos, const char ***arg_descriptions)
Get the detailed information about data iterator. 
 
MXNET_DLL int MXKVStoreGetType(KVStoreHandle handle, const char **type)
get the type of the kvstore 
 
void * RtcHandle
handle to MXRtc 
Definition: c_api.h:89
 
MXNET_DLL int MXNDArrayGetGrad(NDArrayHandle handle, NDArrayHandle *out)
return gradient buffer attached to this NDArray 
 
int(* CustomOpBwdDepFunc)(const int *, const int *, const int *, int *, int **, void *)
Definition: c_api.h:187
 
MXNET_DLL int MXSymbolInferType(SymbolHandle sym, mx_uint num_args, const char **keys, const int *arg_type_data, mx_uint *in_type_size, const int **in_type_data, mx_uint *out_type_size, const int **out_type_data, mx_uint *aux_type_size, const int **aux_type_data, int *complete)
infer type of unknown input types given the known one. The types are packed into a CSR matrix represe...
 
MXNET_DLL int MXKVStoreInit(KVStoreHandle handle, mx_uint num, const int *keys, NDArrayHandle *vals)
Init a list of (key,value) pairs in kvstore. 
 
void(* backward)(int, float **, int *, unsigned **, int *, void *)
Definition: c_api.h:117
 
int(* CustomOpInferStorageTypeFunc)(int, int *, void *)
Definition: c_api.h:181
 
MXNET_DLL int MXImperativeInvokeEx(AtomicSymbolCreator creator, int num_inputs, NDArrayHandle *inputs, int *num_outputs, NDArrayHandle **outputs, int num_params, const char **param_keys, const char **param_vals, const int **out_stypes)
invoke a nnvm op and imperative function 
 
MXNET_DLL int MXRtcCudaModuleFree(CudaModuleHandle handle)
 
const void * FunctionHandle
handle to a mxnet narray function that changes NDArray 
Definition: c_api.h:69
 
MXNET_DLL int MXSetProcessProfilerConfig(int num_params, const char *const *keys, const char *const *vals, KVStoreHandle kvstoreHandle)
Set up configuration of profiler for the process passed as profile_process in keys. 
 
MXNET_DLL int MXRecordIOReaderReadRecord(RecordIOHandle handle, char const **buf, size_t *size)
Write a record to a RecordIO object. 
 
MXNET_DLL int MXProfileCreateFrame(ProfileHandle domain, const char *frame_name, ProfileHandle *out)
Create profile frame. 
 
MXNET_DLL int MXKVStorePush(KVStoreHandle handle, mx_uint num, const int *keys, NDArrayHandle *vals, int priority)
Push a list of (key,value) pairs to kvstore. 
 
MXNET_DLL int MXListFunctions(mx_uint *out_size, FunctionHandle **out_array)
list all the available functions handles most user can use it to list all the needed functions ...
 
void(* list_outputs)(char ***, void *)
Definition: c_api.h:119
 
MXNET_DLL int MXRtcCudaKernelCall(CudaKernelHandle handle, int dev_id, void **args, mx_uint grid_dim_x, mx_uint grid_dim_y, mx_uint grid_dim_z, mx_uint block_dim_x, mx_uint block_dim_y, mx_uint block_dim_z, mx_uint shared_mem)
 
int(* CustomOpInferShapeFunc)(int, int *, unsigned **, void *)
Definition: c_api.h:179
 
MXNET_DLL int MXSymbolFree(SymbolHandle symbol)
Free the symbol handle. 
 
MXNET_DLL int MXExecutorFree(ExecutorHandle handle)
Delete the executor. 
 
MXNET_DLL int MXNDArrayWaitToWrite(NDArrayHandle handle)
Wait until all the pending read/write with respect NDArray are finished. Always call this before writ...
 
int(* CustomOpListFunc)(char ***, void *)
Definition: c_api.h:178
 
MXNET_DLL int MXGetGPUMemoryInformation(int dev, int *free_mem, int *total_mem)
get the free and total available memory on a GPU Note: Deprecated, use MXGetGPUMemoryInformation64 in...
 
MXNET_DLL int MXExecutorForward(ExecutorHandle handle, int is_train)
Executor forward method. 
 
MXNET_DLL int MXNDArrayGetData(NDArrayHandle handle, void **out_pdata)
get the content of the data in NDArray