mxnet
|
C API of mxnet. More...
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
Go to the source code of this file.
Classes | |
struct | NativeOpInfo |
struct | NDArrayOpInfo |
struct | MXCallbackList |
struct | LibFeature |
Macros | |
#define | DEFAULT(x) |
Inhibit C++ name-mangling for MXNet functions. More... | |
#define | MXNET_DLL |
MXNET_DLL prefix for windows. More... | |
#define | MXNET_BRANCH "NotProvided" |
#define | MXNET_COMMIT_HASH "NotProvided" |
#define | MXNDArrayCreateEx MXNDArrayCreate |
Typedefs | |
typedef uint32_t | mx_uint |
manually define unsigned int More... | |
typedef float | mx_float |
manually define float More... | |
typedef int64_t | dim_t |
data type to store dim size More... | |
typedef void * | NDArrayHandle |
handle to NDArray More... | |
typedef void * | AtomicSymbolCreator |
handle to a function that takes param and creates symbol More... | |
typedef void * | CachedOpHandle |
handle to cached operator More... | |
typedef void * | SymbolHandle |
handle to a symbol that can be bind as operator More... | |
typedef void * | AtomicSymbolHandle |
handle to a AtomicSymbol More... | |
typedef void * | ExecutorHandle |
handle to an Executor More... | |
typedef void * | DataIterCreator |
handle a dataiter creator More... | |
typedef void * | DataIterHandle |
handle to a DataIterator More... | |
typedef void * | DatasetCreator |
handle a dataset creator More... | |
typedef void * | DatasetHandle |
handle to a Dataset More... | |
typedef void * | BatchifyFunctionCreator |
handle to a BatchifyFunction creator More... | |
typedef void * | BatchifyFunctionHandle |
handle to a BatchifyFunction More... | |
typedef void * | KVStoreHandle |
handle to KVStore More... | |
typedef void * | RecordIOHandle |
handle to RecordIO More... | |
typedef void * | RtcHandle |
handle to MXRtc More... | |
typedef void * | CudaModuleHandle |
handle to rtc cuda module More... | |
typedef void * | CudaKernelHandle |
handle to rtc cuda kernel More... | |
typedef void * | ProfileHandle |
handle to a Profile object (domain, duration, counter, etc.) More... | |
typedef void * | DLManagedTensorHandle |
handle to DLManagedTensor More... | |
typedef void * | EngineVarHandle |
handle to Engine VarHandle More... | |
typedef void(* | EngineAsyncFunc) (void *, void *, void *, void *) |
Engine asynchronous operation. More... | |
typedef void(* | EngineSyncFunc) (void *, void *) |
Engine synchronous operation. More... | |
typedef void(* | EngineFuncParamDeleter) (void *) |
Callback to free the param for EngineAsyncFunc/EngineSyncFunc. More... | |
typedef void(* | CachedOpMonitorCallback) (const char *, const char *, NDArrayHandle) |
Monitor callback called at operator level for cached op. More... | |
typedef int(* | MXGenericCallback) (void) |
typedef int(* | CustomOpFBFunc) (int, void **, int *, const int *, const int, void *) |
typedef int(* | CustomOpDelFunc) (void *) |
typedef int(* | CustomOpListFunc) (char ***, void *) |
typedef int(* | CustomOpInferShapeFunc) (int, int *, int **, void *) |
typedef int(* | CustomOpInferStorageTypeFunc) (int, int *, void *) |
typedef int(* | CustomOpBackwardInferStorageTypeFunc) (int, int *, int *, void *) |
typedef int(* | CustomOpInferTypeFunc) (int, int *, void *) |
typedef int(* | CustomOpBwdDepFunc) (const int *, const int *, const int *, int *, int **, void *) |
typedef int(* | CustomOpCreateFunc) (const char *, int, unsigned **, const int *, const int *, struct MXCallbackList *, void *) |
typedef int(* | CustomOpPropCreator) (const char *, const int, const char **, const char **, struct MXCallbackList *) |
typedef int(* | CustomFunctionBwdFunc) (int, int, void **, const int *, const int, void *) |
typedef int(* | CustomFunctionDelFunc) (void *) |
typedef 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 More... | |
typedef 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 recv and local More... | |
typedef void() | MXKVStoreServerController(int head, const char *body, void *controller_handle) |
the prototype of a server controller More... | |
Functions | |
const MXNET_DLL char * | MXGetLastError () |
return str message of the last error all function in this file will return 0 when success and -1 when an error occured, MXGetLastError can be called to retrieve the error More... | |
MXNET_DLL int | MXLoadLib (const char *path, unsigned verbose, void **lib) |
Load library dynamically. More... | |
MXNET_DLL int | MXLibInfoFeatures (const struct LibFeature **libFeature, size_t *size) |
Get list of features supported on the runtime. More... | |
MXNET_DLL int | MXLibInfoCompiledWithCXX11ABI (int *result) |
return whether the mxnet library is compiled with cxx11 abi More... | |
MXNET_DLL int | MXRandomSeed (int seed) |
Seed all global random number generators in mxnet. More... | |
MXNET_DLL int | MXRandomSeedContext (int seed, int dev_type, int dev_id) |
Seed the global random number generator of the given device. More... | |
MXNET_DLL int | MXSetFlushDenorms (bool value, bool *prev_state) |
Change floating-point calculations when dealing with denormalized values. Currently this option is only supported in CPU backend. Flushing denormalized values to zero is enabled by default. More... | |
MXNET_DLL int | MXNotifyShutdown () |
Notify the engine about a shutdown, This can help engine to print less messages into display. More... | |
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. More... | |
MXNET_DLL int | MXSetProfilerConfig (int num_params, const char *const *keys, const char *const *vals) |
Set up configuration of profiler for worker/current process. More... | |
MXNET_DLL int | MXSetProcessProfilerState (int state, int profile_process, KVStoreHandle kvStoreHandle) |
Set up state of profiler for either worker or server process. More... | |
MXNET_DLL int | MXSetProfilerState (int state) |
Set up state of profiler for current process. More... | |
MXNET_DLL int | MXSetProfilerScope (const char *scope) |
Set the scope of profiler for current process. More... | |
MXNET_DLL int | MXDumpProcessProfile (int finished, int profile_process, KVStoreHandle kvStoreHandle) |
Save profile and stop profiler. More... | |
MXNET_DLL int | MXDumpProfile (int finished) |
Save profile and stop profiler for worker/current process. More... | |
MXNET_DLL int | MXAggregateProfileStatsPrint (const char **out_str, int reset, int format, int sort_by, int ascending) |
Print sorted aggregate stats to the a string How aggregate stats are stored will not change. More... | |
MXNET_DLL int | MXProcessProfilePause (int paused, int profile_process, KVStoreHandle kvStoreHandle) |
Pause profiler tuning collection. More... | |
MXNET_DLL int | MXProfilePause (int paused) |
Pause profiler tuning collection for worker/current process. More... | |
MXNET_DLL int | MXProfileCreateDomain (const char *domain, ProfileHandle *out) |
Create profiling domain. More... | |
MXNET_DLL int | MXProfileCreateTask (ProfileHandle domain, const char *task_name, ProfileHandle *out) |
Create profile task. More... | |
MXNET_DLL int | MXProfileCreateFrame (ProfileHandle domain, const char *frame_name, ProfileHandle *out) |
Create profile frame. More... | |
MXNET_DLL int | MXProfileCreateEvent (const char *event_name, ProfileHandle *out) |
Create profile event. More... | |
MXNET_DLL int | MXProfileCreateCounter (ProfileHandle domain, const char *counter_name, ProfileHandle *out) |
Create profile counter. More... | |
MXNET_DLL int | MXProfileDestroyHandle (ProfileHandle frame_handle) |
Destroy a frame. More... | |
MXNET_DLL int | MXProfileDurationStart (ProfileHandle duration_handle) |
Start timing the duration of a profile duration object such as an event, task or frame. More... | |
MXNET_DLL int | MXProfileDurationStop (ProfileHandle duration_handle) |
Stop timing the duration of a profile duration object such as an event, task or frame. More... | |
MXNET_DLL int | MXProfileSetCounter (ProfileHandle counter_handle, uint64_t value) |
Set a counter, given its handle. More... | |
MXNET_DLL int | MXProfileAdjustCounter (ProfileHandle counter_handle, int64_t value) |
Adjust a counter by the given amount, given its handle. More... | |
MXNET_DLL int | MXProfileSetMarker (ProfileHandle domain, const char *instant_marker_name, const char *scope) |
Mark a single instant in time. More... | |
MXNET_DLL int | MXSetNumOMPThreads (int thread_num) |
Set the number of OMP threads to use. More... | |
MXNET_DLL int | MXEngineSetBulkSize (int bulk_size, int *prev_bulk_size) |
set bulk execution limit More... | |
MXNET_DLL int | MXGetGPUCount (int *out) |
Get the number of GPUs. More... | |
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 instead. More... | |
MXNET_DLL int | MXGetGPUMemoryInformation64 (int dev, uint64_t *free_mem, uint64_t *total_mem) |
get the free and total available memory on a GPU More... | |
MXNET_DLL int | MXGetVersion (int *out) |
get the MXNet library version as an integer More... | |
MXNET_DLL int | MXGetBranch (const char **out) |
get the MXNet library branch at build time, usually provided by cmake More... | |
MXNET_DLL int | MXGetCommitHash (const char **out) |
get the MXNet library commit hash at build time, usually provided by cmake More... | |
MXNET_DLL int | MXNDArrayCreateNone (NDArrayHandle *out) |
Load TVM operator from the binary library. More... | |
MXNET_DLL int | MXNDArrayCreate (const uint32_t *shape, uint32_t ndim, int dev_type, int dev_id, int delay_alloc, int dtype, NDArrayHandle *out) |
create a NDArray with specified shape and data type This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default) More... | |
MXNET_DLL int | MXNDArrayCreate64 (const int64_t *shape, int ndim, int dev_type, int dev_id, int delay_alloc, int dtype, NDArrayHandle *out) |
create a NDArray with specified shape and data type This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support More... | |
MXNET_DLL int | MXNDArrayCreateSparseEx (int storage_type, const uint32_t *shape, uint32_t ndim, int dev_type, int dev_id, int delay_alloc, int dtype, uint32_t num_aux, int *aux_type, uint32_t *aux_ndims, const uint32_t *aux_shape, NDArrayHandle *out) |
create an empty sparse NDArray with specified shape and data type This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default) More... | |
MXNET_DLL int | MXNDArrayCreateSparseEx64 (int storage_type, const int64_t *shape, int ndim, int dev_type, int dev_id, int delay_alloc, int dtype, uint32_t num_aux, int *aux_type, int *aux_ndims, const int64_t *aux_shape, NDArrayHandle *out) |
create an empty sparse NDArray with specified shape and data type This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support More... | |
MXNET_DLL int | MXNDArrayLoadFromRawBytes (const void *buf, size_t size, NDArrayHandle *out) |
create a NDArray handle that is loaded from raw bytes. More... | |
MXNET_DLL int | MXNDArraySaveRawBytes (NDArrayHandle handle, size_t *out_size, const char **out_buf) |
save the NDArray into raw bytes. More... | |
MXNET_DLL int | MXNDArrayLegacySave (const char *fname, uint32_t num_args, NDArrayHandle *args, const char **keys) |
Save list of narray into the file. More... | |
MXNET_DLL int | MXNDArraySave (const char *fname, uint32_t num_args, NDArrayHandle *args, const char **keys) |
Save list of narray into the file. More... | |
MXNET_DLL int | MXNDArrayLoad (const char *fname, uint32_t *out_size, NDArrayHandle **out_arr, uint32_t *out_name_size, const char ***out_names) |
Load list of narray from the file. More... | |
MXNET_DLL int | MXNDArrayLoadFromBuffer (const void *ndarray_buffer, size_t size, uint32_t *out_size, NDArrayHandle **out_arr, uint32_t *out_name_size, const char ***out_names) |
Load list / dictionary of narrays from file content loaded into memory. This will load a list of ndarrays in a similar manner to MXNDArrayLoad, however, it loads from buffer containing the contents of a file, rather than from a specified file. More... | |
MXNET_DLL int | MXNDArraySyncCopyFromCPU (NDArrayHandle handle, const void *data, size_t size) |
Perform a synchronize copy from a contiguous CPU memory region. More... | |
MXNET_DLL int | MXNDArraySyncCopyToCPU (NDArrayHandle handle, void *data, size_t size) |
Perform a synchronize copyto a contiguous CPU memory region. More... | |
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. Do not use it in performance critical code. More... | |
MXNET_DLL int | MXNDArraySyncCheckFormat (NDArrayHandle handle, const bool full_check) |
check whether the NDArray format is valid More... | |
MXNET_DLL int | MXNDArrayWaitToRead (NDArrayHandle handle) |
Wait until all the pending writes with respect NDArray are finished. Always call this before read data out synchronizely. More... | |
MXNET_DLL int | MXNDArrayWaitToWrite (NDArrayHandle handle) |
Wait until all the pending read/write with respect NDArray are finished. Always call this before write data into NDArray synchronizely. More... | |
MXNET_DLL int | MXNDArrayWaitAll () |
wait until all delayed operations in the system is completed More... | |
MXNET_DLL int | MXNDArrayFree (NDArrayHandle handle) |
free the narray handle More... | |
MXNET_DLL int | MXNDArraySlice (NDArrayHandle handle, uint32_t slice_begin, uint32_t slice_end, NDArrayHandle *out) |
Slice the NDArray along axis 0. This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default) More... | |
MXNET_DLL int | MXNDArraySlice64 (NDArrayHandle handle, int64_t slice_begin, int64_t slice_end, NDArrayHandle *out) |
Slice the NDArray along axis 0. This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support. More... | |
MXNET_DLL int | MXNDArrayAt (NDArrayHandle handle, uint32_t idx, NDArrayHandle *out) |
Index the NDArray along axis 0. This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default) More... | |
MXNET_DLL int | MXNDArrayAt64 (NDArrayHandle handle, int64_t idx, NDArrayHandle *out) |
Index the NDArray along axis 0. This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support. More... | |
MXNET_DLL int | MXNDArrayGetStorageType (NDArrayHandle handle, int *out_storage_type) |
get the storage type of the array More... | |
MXNET_DLL int | MXNDArrayReshape (NDArrayHandle handle, int ndim, int *dims, NDArrayHandle *out) |
Reshape the NDArray. More... | |
MXNET_DLL int | MXNDArrayReshape64 (NDArrayHandle handle, int ndim, dim_t *dims, bool reverse, NDArrayHandle *out) |
Reshape the NDArray. More... | |
MXNET_DLL int | MXNDArrayGetShape (NDArrayHandle handle, int *out_dim, const int **out_pdata) |
get the shape of the array This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default) More... | |
MXNET_DLL int | MXNDArrayGetShape64 (NDArrayHandle handle, int *out_dim, const int64_t **out_pdata) |
get the shape of the array This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support More... | |
MXNET_DLL int | MXNDArrayGetData (NDArrayHandle handle, void **out_pdata) |
get the content of the data in NDArray More... | |
MXNET_DLL int | MXNDArrayToDLPack (NDArrayHandle handle, DLManagedTensorHandle *out_dlpack) |
Create a reference view of NDArray that represents as DLManagedTensor Notice: MXNet uses asynchronous execution. Please call MXNDArrayWaitToRead or MXNDArrayWaitToWrite before calling MXNDArrayToDLPack. More... | |
MXNET_DLL int | MXNDArrayFromDLPack (DLManagedTensorHandle dlpack, const bool transient_handle, NDArrayHandle *out_handle) |
Create a NDArray backed by a dlpack tensor. More... | |
MXNET_DLL int | MXNDArrayCallDLPackDeleter (DLManagedTensorHandle dlpack) |
Delete a dlpack tensor. More... | |
MXNET_DLL int | MXNDArrayGetDType (NDArrayHandle handle, int *out_dtype) |
get the type of the data in NDArray More... | |
MXNET_DLL int | MXNDArrayGetAuxType (NDArrayHandle handle, uint32_t i, int *out_type) |
get the type of the ith aux data in NDArray This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default) More... | |
MXNET_DLL int | MXNDArrayGetAuxType64 (NDArrayHandle handle, int64_t i, int *out_type) |
get the type of the ith aux data in NDArray This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support More... | |
MXNET_DLL int | MXNDArrayGetAuxNDArray (NDArrayHandle handle, uint32_t i, NDArrayHandle *out) |
Get a deep copy of the ith aux data blob This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default) in the form of an NDArray of default storage type. This function blocks. Do not use it in performance critical code. More... | |
MXNET_DLL int | MXNDArrayGetAuxNDArray64 (NDArrayHandle handle, int64_t i, NDArrayHandle *out) |
Get a deep copy of the ith aux data blob This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support in the form of an NDArray of default storage type. This function blocks. Do not use it in performance critical code. More... | |
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. More... | |
MXNET_DLL int | MXNDArrayGetContext (NDArrayHandle handle, int *out_dev_type, int *out_dev_id) |
get the context of the NDArray More... | |
MXNET_DLL int | MXNDArrayGetGrad (NDArrayHandle handle, NDArrayHandle *out) |
return gradient buffer attached to this NDArray More... | |
MXNET_DLL int | MXNDArrayDetach (NDArrayHandle handle, NDArrayHandle *out) |
detach and ndarray from computation graph by clearing entry_ More... | |
MXNET_DLL int | MXNDArraySetGradState (NDArrayHandle handle, int state) |
set the flag for gradient array state. More... | |
MXNET_DLL int | MXNDArrayGetGradState (NDArrayHandle handle, int *out) |
set the flag for gradient array state. More... | |
MXNET_DLL int | MXListFunctions (uint32_t *out_size, FunctionHandle **out_array) |
list all the available functions handles most user can use it to list all the needed functions More... | |
MXNET_DLL int | MXGetFunction (const char *name, FunctionHandle *out) |
get the function handle by name More... | |
MXNET_DLL int | MXFuncGetInfo (FunctionHandle fun, 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 **return_type DEFAULT(NULL)) |
Get the information of the function handle. More... | |
MXNET_DLL int | MXFuncDescribe (FunctionHandle fun, uint32_t *num_use_vars, uint32_t *num_scalars, uint32_t *num_mutate_vars, int *type_mask) |
get the argument requirements of the function More... | |
MXNET_DLL int | MXFuncInvoke (FunctionHandle fun, NDArrayHandle *use_vars, 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 More... | |
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, const int **out_stypes) |
invoke a nnvm op and imperative function More... | |
MXNET_DLL int | MXAutogradSetIsRecording (int is_recording, int *prev) |
set whether to record operator for autograd More... | |
MXNET_DLL int | MXAutogradSetIsTraining (int is_training, int *prev) |
set whether to record operator for autograd More... | |
MXNET_DLL int | MXAutogradIsRecording (bool *curr) |
get whether autograd recording is on More... | |
MXNET_DLL int | MXAutogradIsTraining (bool *curr) |
get whether training mode is on More... | |
MXNET_DLL int | MXSetOptimizationConstraints (unsigned int constraints, unsigned int *prev) |
set what optimization constraints to apply More... | |
MXNET_DLL int | MXGetOptimizationConstraints (unsigned int *curr) |
get current optimization constraints More... | |
MXNET_DLL int | MXIsNumpyShape (int *curr) |
get whether numpy compatibility is on More... | |
MXNET_DLL int | MXSetIsNumpyShape (int is_np_shape, int *prev) |
set numpy compatibility switch More... | |
MXNET_DLL int | MXIsNumpyDefaultDtype (bool *curr) |
get numpy default data type More... | |
MXNET_DLL int | MXSetIsNumpyDefaultDtype (bool dtype_flag, bool *prev) |
set numpy default data type More... | |
MXNET_DLL int | MXAutogradMarkVariables (uint32_t num_var, NDArrayHandle *var_handles, uint32_t *reqs_array, NDArrayHandle *grad_handles) |
mark NDArrays as variables to compute gradient for autograd More... | |
MXNET_DLL int | MXAutogradDropGrads (uint32_t num_var, NDArrayHandle *var_handles) |
unmark nonleaf NDArrays to free the memory More... | |
MXNET_DLL int | MXAutogradComputeGradient (uint32_t num_output, NDArrayHandle *output_handles) |
compute the gradient of outputs w.r.t variabels More... | |
MXNET_DLL int | MXAutogradBackward (uint32_t num_output, NDArrayHandle *output_handles, NDArrayHandle *ograd_handles, int retain_graph) |
compute the gradient of outputs w.r.t variabels More... | |
MXNET_DLL int | MXAutogradBackwardEx (uint32_t num_output, NDArrayHandle *output_handles, NDArrayHandle *ograd_handles, uint32_t 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 More... | |
MXNET_DLL int | MXAutogradGetSymbol (NDArrayHandle handle, SymbolHandle *out) |
MXNET_DLL int | MXCreateCachedOp (SymbolHandle handle, int num_flags, const char **keys, const char **vals, CachedOpHandle *out, bool thread_safe DEFAULT(false)) |
create cached operator, allows to choose thread_safe version of cachedop More... | |
MXNET_DLL int | MXFreeCachedOp (CachedOpHandle handle) |
free cached operator More... | |
MXNET_DLL int | MXCachedOpGetOptimizedSymbol (CachedOpHandle handle, SymbolHandle *out) |
get optimized graph from the cached op More... | |
MXNET_DLL int | MXInvokeCachedOp (CachedOpHandle handle, int num_inputs, NDArrayHandle *inputs, int default_dev_type, int default_dev_id, int *num_outputs, NDArrayHandle **outputs, const int **out_stypes) |
invoke a cached op More... | |
MXNET_DLL int | MXCachedOpRegisterOpHook (CachedOpHandle handle, CachedOpMonitorCallback callback, bool monitor_all) |
cached op set monitor callback More... | |
MXNET_DLL int | MXNDArrayIsDeferredCompute (int *curr) |
Get current status of deferred compute mode. More... | |
MXNET_DLL int | MXNDArraySetIsDeferredCompute (int deferred_compute_enabled, int *prev) |
set whether to enable deferred compute mode More... | |
MXNET_DLL int | MXNDArraySetDeferredComputeVariable (NDArrayHandle *arrays, SymbolHandle *variables, int num) |
Associate variables with deferred compute arrays. More... | |
MXNET_DLL int | MXNDArrayGetDeferredComputeSymbol (NDArrayHandle *output_handles, int num_outputs, SymbolHandle *out) |
Convert the graph constructed during deferred computation mode to a Symbol. More... | |
MXNET_DLL int | MXNDArrayClearDeferredCompute (NDArrayHandle *arrays, int num) |
Clear the deferred compute info associated with the ndarrays. More... | |
MXNET_DLL int | MXListAllOpNames (uint32_t *out_size, const char ***out_array) |
list all the available operator names, include entries. More... | |
MXNET_DLL int | MXSymbolListAtomicSymbolCreators (uint32_t *out_size, AtomicSymbolCreator **out_array) |
list all the available AtomicSymbolEntry More... | |
MXNET_DLL int | MXSymbolGetAtomicSymbolName (AtomicSymbolCreator creator, const char **name) |
Get the name of an atomic symbol. More... | |
MXNET_DLL int | MXSymbolGetInputSymbols (SymbolHandle sym, SymbolHandle **inputs, int *input_size) |
Get the input symbols of the graph. More... | |
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. A variable node will be created for each edge that connects to nodes outside the subgraph. The outside nodes that connect to the subgraph will be returned. More... | |
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. More... | |
MXNET_DLL int | MXSymbolCreateAtomicSymbol (AtomicSymbolCreator creator, uint32_t num_param, const char **keys, const char **vals, SymbolHandle *out) |
Create an AtomicSymbol. More... | |
MXNET_DLL int | MXSymbolCreateVariable (const char *name, SymbolHandle *out) |
Create a Variable Symbol. More... | |
MXNET_DLL int | MXSymbolCreateGroup (uint32_t num_symbols, SymbolHandle *symbols, SymbolHandle *out) |
Create a Symbol by grouping list of symbols together. More... | |
MXNET_DLL int | MXSymbolCreateFromFile (const char *fname, SymbolHandle *out) |
Load a symbol from a json file. More... | |
MXNET_DLL int | MXSymbolCreateFromJSON (const char *json, SymbolHandle *out) |
Load a symbol from a json string. More... | |
MXNET_DLL int | MXSymbolRemoveAmpCast (SymbolHandle sym_handle, SymbolHandle *ret_sym_handle) |
Remove the operators amp_cast and amp_multicast. More... | |
MXNET_DLL int | MXSymbolSaveToFile (SymbolHandle symbol, const char *fname) |
Save a symbol into a json file. More... | |
MXNET_DLL int | MXSymbolSaveToJSON (SymbolHandle symbol, const char **out_json) |
Save a symbol into a json string. More... | |
MXNET_DLL int | MXSymbolFree (SymbolHandle symbol) |
Free the symbol handle. More... | |
MXNET_DLL int | MXSymbolCopy (SymbolHandle symbol, SymbolHandle *out) |
Copy the symbol to another handle. More... | |
MXNET_DLL int | MXSymbolPrint (SymbolHandle symbol, const char **out_str) |
Print the content of symbol, used for debug. More... | |
MXNET_DLL int | MXSymbolGetName (SymbolHandle symbol, const char **out, int *success) |
Get string name from symbol. More... | |
MXNET_DLL int | MXSymbolGetAttr (SymbolHandle symbol, const char *key, const char **out, int *success) |
Get string attribute from symbol. More... | |
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(mutable/immutable) of symbolic graph. More... | |
MXNET_DLL int | MXSymbolListAttr (SymbolHandle symbol, uint32_t *out_size, const char ***out) |
Get all attributes from symbol, including all descendents. More... | |
MXNET_DLL int | MXSymbolListAttrShallow (SymbolHandle symbol, uint32_t *out_size, const char ***out) |
Get all attributes from symbol, excluding descendents. More... | |
MXNET_DLL int | MXSymbolListArguments (SymbolHandle symbol, uint32_t *out_size, const char ***out_str_array) |
List arguments in the symbol. More... | |
MXNET_DLL int | MXSymbolListOutputs (SymbolHandle symbol, uint32_t *out_size, const char ***out_str_array) |
List returns in the symbol. More... | |
MXNET_DLL int | MXSymbolGetNumOutputs (SymbolHandle symbol, uint32_t *output_count) |
Get number of outputs of the symbol. More... | |
MXNET_DLL int | MXSymbolGetInternals (SymbolHandle symbol, SymbolHandle *out) |
Get a symbol that contains all the internals. More... | |
MXNET_DLL int | MXSymbolGetInputs (SymbolHandle symbol, SymbolHandle *out) |
Get a symbol that contains all the inputs. More... | |
MXNET_DLL int | MXSymbolGetChildren (SymbolHandle symbol, SymbolHandle *out) |
Get a symbol that contains only direct children. More... | |
MXNET_DLL int | MXSymbolGetOutput (SymbolHandle symbol, uint32_t index, SymbolHandle *out) |
Get index-th outputs of the symbol. More... | |
MXNET_DLL int | MXSymbolListAuxiliaryStates (SymbolHandle symbol, uint32_t *out_size, const char ***out_str_array) |
List auxiliary states in the symbol. More... | |
MXNET_DLL int | MXSymbolCompose (SymbolHandle sym, const char *name, uint32_t num_args, const char **keys, SymbolHandle *args) |
Compose the symbol on other symbols. More... | |
MXNET_DLL int | MXSymbolGrad (SymbolHandle sym, uint32_t num_wrt, const char **wrt, SymbolHandle *out) |
Get the gradient graph of the symbol. More... | |
MXNET_DLL int | MXSymbolInferShape (SymbolHandle sym, uint32_t num_args, const char **keys, const uint32_t *arg_ind_ptr, const int *arg_shape_data, uint32_t *in_shape_size, const int **in_shape_ndim, const int ***in_shape_data, uint32_t *out_shape_size, const int **out_shape_ndim, const int ***out_shape_data, uint32_t *aux_shape_size, const int **aux_shape_ndim, const int ***aux_shape_data, int *complete) |
infer shape of unknown input shapes given the known one. The shapes are packed into a CSR matrix represented by arg_ind_ptr and arg_shape_data The call will be treated as a kwargs call if key != NULL or num_args==0, otherwise it is positional. This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default) More... | |
MXNET_DLL int | MXSymbolInferShape64 (SymbolHandle sym, uint32_t num_args, const char **keys, const int64_t *arg_ind_ptr, const int64_t *arg_shape_data, size_t *in_shape_size, const int **in_shape_ndim, const int64_t ***in_shape_data, size_t *out_shape_size, const int **out_shape_ndim, const int64_t ***out_shape_data, size_t *aux_shape_size, const int **aux_shape_ndim, const int64_t ***aux_shape_data, int *complete) |
infer shape of unknown input shapes given the known one. The shapes are packed into a CSR matrix represented by arg_ind_ptr and arg_shape_data More... | |
MXNET_DLL int | MXSymbolInferShapePartial (SymbolHandle sym, uint32_t num_args, const char **keys, const uint32_t *arg_ind_ptr, const int *arg_shape_data, uint32_t *in_shape_size, const int **in_shape_ndim, const int ***in_shape_data, uint32_t *out_shape_size, const int **out_shape_ndim, const int ***out_shape_data, uint32_t *aux_shape_size, const int **aux_shape_ndim, const int ***aux_shape_data, int *complete) |
partially infer shape of unknown input shapes given the known one. More... | |
MXNET_DLL int | MXSymbolInferShapePartial64 (SymbolHandle sym, uint32_t num_args, const char **keys, const int64_t *arg_ind_ptr, const int64_t *arg_shape_data, size_t *in_shape_size, const int **in_shape_ndim, const int64_t ***in_shape_data, size_t *out_shape_size, const int **out_shape_ndim, const int64_t ***out_shape_data, size_t *aux_shape_size, const int **aux_shape_ndim, const int64_t ***aux_shape_data, int *complete) |
partially infer shape of unknown input shapes given the known one. More... | |
MXNET_DLL int | MXSymbolInferType (SymbolHandle sym, uint32_t num_args, const char **keys, const int *arg_type_data, uint32_t *in_type_size, const int **in_type_data, uint32_t *out_type_size, const int **out_type_data, uint32_t *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 represented by arg_ind_ptr and arg_type_data The call will be treated as a kwargs call if key != NULL or num_args==0, otherwise it is positional. More... | |
MXNET_DLL int | MXSymbolInferTypePartial (SymbolHandle sym, uint32_t num_args, const char **keys, const int *arg_type_data, uint32_t *in_type_size, const int **in_type_data, uint32_t *out_type_size, const int **out_type_data, uint32_t *aux_type_size, const int **aux_type_data, int *complete) |
partially infer type of unknown input types given the known one. More... | |
MXNET_DLL int | MXQuantizeSymbol (SymbolHandle sym_handle, SymbolHandle *ret_sym_handle, const int *dev_type, const uint32_t num_excluded_sym_names, const char **excluded_sym_names, const uint32_t num_excluded_op_names, const char **excluded_op_names, const uint32_t num_offline, const char **offline_params, const char *quantized_dtype, const bool calib_quantize, const char *quantize_mode, const char *quantize_granularity, uint32_t *out_num_calib_names, const char ***out_calib_names) |
Convert a symbol into a quantized symbol where FP32 operators are replaced with INT8. More... | |
MXNET_DLL int | MXReducePrecisionSymbol (SymbolHandle sym_handle, SymbolHandle *ret_sym_handle, const int target_dtype, const int cast_params_offline, const char *const offline_param_cast_attr_p, const uint32_t num_inputs, const char **const input_names_p, const uint32_t num_all_args, const char **const all_arg_names_p, const int *all_arg_types_p, const uint32_t num_target_dtype_ops, const char **const target_dtype_ops_p, const uint32_t num_fp32_ops, const char **const fp32_ops_p, const uint32_t num_widest_dtype_ops, const char **const widest_dtype_ops_p) |
Convert a symbol into a mixed precision symbol with cast operators for target dtype casting. More... | |
MXNET_DLL int | MXSetCalibTableToQuantizedSymbol (SymbolHandle qsym_handle, const uint32_t 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. More... | |
MXNET_DLL int | MXGenBackendSubgraph (SymbolHandle sym_handle, const char *backend, SymbolHandle *ret_sym_handle) |
Run subgraph pass based on the backend provided. More... | |
MXNET_DLL int | MXGenAtomicSymbolFromSymbol (SymbolHandle sym_handle, SymbolHandle *ret_sym_handle) |
Generate atomic symbol (able to be composed) from a source symbol. More... | |
MXNET_DLL int | MXOptimizeForBackend (SymbolHandle sym_handle, const char *backend_name, const int dev_type, SymbolHandle *ret_sym_handle, const mx_uint args_len, NDArrayHandle *in_args_handle, const mx_uint aux_len, NDArrayHandle *in_aux_handle, const mx_uint num_options, const char **keys, const char **vals, const uint32_t num_input_shapes, const char **input_shape_names, const int64_t *input_shape_data, const uint32_t *input_shape_idx, const uint32_t num_input_dtypes, const char **input_dtype_names, const int *input_dtypes, const uint32_t num_input_stypes, const char **input_stype_names, const int *input_stypes, bool skip_infer, int *new_args_cnt, NDArrayHandle **new_args_handle, char ***new_arg_names_handle, int *new_aux_cnt, NDArrayHandle **new_aux_handle, char ***new_aux_names_handle) |
Partitions symbol for given backend, potentially creating subgraphs. More... | |
MXNET_DLL int | MXListDataIters (uint32_t *out_size, DataIterCreator **out_array) |
List all the available iterator entries. More... | |
MXNET_DLL int | MXDataIterCreateIter (DataIterCreator handle, uint32_t num_param, const char **keys, const char **vals, DataIterHandle *out) |
Init an iterator, init with parameters the array size of passed in arguments. More... | |
MXNET_DLL int | MXDataIterGetIterInfo (DataIterCreator creator, const char **name, const char **description, uint32_t *num_args, const char ***arg_names, const char ***arg_type_infos, const char ***arg_descriptions) |
Get the detailed information about data iterator. More... | |
MXNET_DLL int | MXDataIterFree (DataIterHandle handle) |
Free the handle to the IO module. More... | |
MXNET_DLL int | MXDataIterNext (DataIterHandle handle, int *out) |
Move iterator to next position. More... | |
MXNET_DLL int | MXDataIterBeforeFirst (DataIterHandle handle) |
Call iterator.Reset. More... | |
MXNET_DLL int | MXDataIterGetLenHint (DataIterHandle handle, int64_t *len) |
Call iterator.GetLenHint. Note that some iterators don't provide length. More... | |
MXNET_DLL int | MXDataIterGetData (DataIterHandle handle, NDArrayHandle *out) |
Get the handle to the NDArray of underlying data. More... | |
MXNET_DLL int | MXDataIterGetIndex (DataIterHandle handle, uint64_t **out_index, uint64_t *out_size) |
Get the image index by array. More... | |
MXNET_DLL int | MXDataIterGetPadNum (DataIterHandle handle, int *pad) |
Get the padding number in current data batch. More... | |
MXNET_DLL int | MXDataIterGetLabel (DataIterHandle handle, NDArrayHandle *out) |
Get the handle to the NDArray of underlying label. More... | |
MXNET_DLL int | MXDataIterGetItems (DataIterHandle handle, int *num_outputs, NDArrayHandle **outputs) |
Get the handles to specified underlying ndarrays of index. More... | |
MXNET_DLL int | MXListDatasets (uint32_t *out_size, DatasetCreator **out_array) |
List all the available dataset entries. More... | |
MXNET_DLL int | MXDatasetCreateDataset (DatasetCreator handle, uint32_t num_param, const char **keys, const char **vals, DatasetHandle *out) |
Init an dataset, init with parameters the array size of passed in arguments. More... | |
MXNET_DLL int | MXDatasetGetDatasetInfo (DatasetCreator creator, const char **name, const char **description, uint32_t *num_args, const char ***arg_names, const char ***arg_type_infos, const char ***arg_descriptions) |
Get the detailed information about dataset. More... | |
MXNET_DLL int | MXDatasetFree (DatasetHandle handle) |
Free the handle to the IO module. More... | |
MXNET_DLL int | MXDatasetGetLen (DatasetHandle handle, uint64_t *out) |
Get dataset overal length(size) More... | |
MXNET_DLL int | MXDatasetGetItems (DatasetHandle handle, uint64_t index, int *num_outputs, NDArrayHandle **outputs) |
Get Output NDArray given specified indices. More... | |
MXNET_DLL int | MXListBatchifyFunctions (uint32_t *out_size, BatchifyFunctionCreator **out_array) |
List all the available batchify function entries. More... | |
MXNET_DLL int | MXBatchifyFunctionCreateFunction (BatchifyFunctionCreator handle, uint32_t num_param, const char **keys, const char **vals, BatchifyFunctionHandle *out) |
Init an batchify function, init with parameters the array size of passed in arguments. More... | |
MXNET_DLL int | MXBatchifyFunctionGetFunctionInfo (BatchifyFunctionCreator creator, const char **name, const char **description, uint32_t *num_args, const char ***arg_names, const char ***arg_type_infos, const char ***arg_descriptions) |
Get the detailed information about batchify function. More... | |
MXNET_DLL int | MXBatchifyFunctionInvoke (BatchifyFunctionHandle handle, int batch_size, int num_output, NDArrayHandle *inputs, NDArrayHandle **outputs) |
Invoke the Batchify Function. More... | |
MXNET_DLL int | MXBatchifyFunctionFree (BatchifyFunctionHandle handle) |
Free the handle to the IO module. More... | |
MXNET_DLL int | MXInitPSEnv (uint32_t num_vars, const char **keys, const char **vals) |
Initialized ps-lite environment variables. More... | |
MXNET_DLL int | MXKVStoreCreate (const char *type, KVStoreHandle *out) |
Create a kvstore. More... | |
MXNET_DLL int | MXKVStoreSetGradientCompression (KVStoreHandle handle, uint32_t num_params, const char **keys, const char **vals) |
Set parameters to use low-bit compressed gradients. More... | |
MXNET_DLL int | MXKVStoreFree (KVStoreHandle handle) |
Delete a KVStore handle. More... | |
MXNET_DLL int | MXKVStoreInit (KVStoreHandle handle, uint32_t num, const int *keys, NDArrayHandle *vals) |
Init a list of (key,value) pairs in kvstore. More... | |
MXNET_DLL int | MXKVStoreInitEx (KVStoreHandle handle, uint32_t num, const char **keys, NDArrayHandle *vals) |
Init a list of (key,value) pairs in kvstore, where each key is a string. More... | |
MXNET_DLL int | MXKVStorePush (KVStoreHandle handle, uint32_t num, const int *keys, NDArrayHandle *vals, int priority) |
Push a list of (key,value) pairs to kvstore. More... | |
MXNET_DLL int | MXKVStorePushEx (KVStoreHandle handle, uint32_t num, const char **keys, NDArrayHandle *vals, int priority) |
Push a list of (key,value) pairs to kvstore, where each key is a string. More... | |
MXNET_DLL int | MXKVStorePullWithSparse (KVStoreHandle handle, uint32_t num, const int *keys, NDArrayHandle *vals, int priority, bool ignore_sparse) |
pull a list of (key, value) pairs from the kvstore More... | |
MXNET_DLL int | MXKVStorePullWithSparseEx (KVStoreHandle handle, uint32_t 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 More... | |
MXNET_DLL int | MXKVStorePull (KVStoreHandle handle, uint32_t num, const int *keys, NDArrayHandle *vals, int priority) |
pull a list of (key, value) pairs from the kvstore More... | |
MXNET_DLL int | MXKVStorePullEx (KVStoreHandle handle, uint32_t num, const char **keys, NDArrayHandle *vals, int priority) |
pull a list of (key, value) pairs from the kvstore, where each key is a string More... | |
MXNET_DLL int | MXKVStorePullRowSparse (KVStoreHandle handle, uint32_t 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 back will be in row_sparse storage with only the specified row_ids present based row_ids (others rows are zeros). More... | |
MXNET_DLL int | MXKVStorePullRowSparseEx (KVStoreHandle handle, uint32_t 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 back will be in row_sparse storage with only the specified row_ids present based row_ids (others rows are zeros). More... | |
MXNET_DLL int | MXKVStoreBroadcast (KVStoreHandle handle, mx_uint vnum, const int *vkeys, mx_uint onum, const int *okeys, NDArrayHandle *vals, NDArrayHandle *outs, int priority) |
broadcast a list of (key, value) pairs from the kvstore More... | |
MXNET_DLL int | MXKVStoreBroadcastEx (KVStoreHandle handle, mx_uint vnum, const char **vkeys, mx_uint onum, const char **okeys, NDArrayHandle *vals, NDArrayHandle *outs, int priority) |
broadcast a list of (key, value) pairs from the kvstore, where each key is a string More... | |
MXNET_DLL int | MXKVStorePushPull (KVStoreHandle handle, mx_uint vnum, const int *vkeys, mx_uint onum, const int *okeys, NDArrayHandle *vals, NDArrayHandle *outs, int priority) |
push and pull a list of (key, value) pairs from the kvstore More... | |
MXNET_DLL int | MXKVStorePushPullEx (KVStoreHandle handle, mx_uint vnum, const char **vkeys, mx_uint onum, const char **okeys, NDArrayHandle *vals, NDArrayHandle *outs, int priority) |
push and pull a list of (key, value) pairs from the kvstore, where each key is a string More... | |
MXNET_DLL int | MXKVStoreSetUpdater (KVStoreHandle handle, MXKVStoreUpdater updater, void *updater_handle) |
register a push updater More... | |
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 More... | |
MXNET_DLL int | MXKVStoreGetType (KVStoreHandle handle, const char **type) |
get the type of the kvstore More... | |
MXNET_DLL int | MXKVStoreGetRank (KVStoreHandle handle, int *ret) |
return The rank of this node in its group, which is in [0, GroupSize). More... | |
MXNET_DLL int | MXKVStoreGetGroupSize (KVStoreHandle handle, int *ret) |
return The number of nodes in this group, which is More... | |
MXNET_DLL int | MXKVStoreIsWorkerNode (int *ret) |
return whether or not this process is a worker node. More... | |
MXNET_DLL int | MXKVStoreIsServerNode (int *ret) |
return whether or not this process is a server node. More... | |
MXNET_DLL int | MXKVStoreIsSchedulerNode (int *ret) |
return whether or not this process is a scheduler node. More... | |
MXNET_DLL int | MXKVStoreBarrier (KVStoreHandle handle) |
global barrier among all worker machines More... | |
MXNET_DLL int | MXKVStoreSetBarrierBeforeExit (KVStoreHandle handle, const int barrier_before_exit) |
whether to do barrier when finalize More... | |
MXNET_DLL int | MXKVStoreRunServer (KVStoreHandle handle, MXKVStoreServerController controller, void *controller_handle) |
Run as server (or scheduler) More... | |
MXNET_DLL int | MXKVStoreSendCommmandToServers (KVStoreHandle handle, int cmd_id, const char *cmd_body) |
Send a command to all server nodes. More... | |
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}. More... | |
MXNET_DLL int | MXRecordIOWriterCreate (const char *uri, RecordIOHandle *out) |
Create a RecordIO writer object. More... | |
MXNET_DLL int | MXRecordIOWriterFree (RecordIOHandle handle) |
Delete a RecordIO writer object. More... | |
MXNET_DLL int | MXRecordIOWriterWriteRecord (RecordIOHandle handle, const char *buf, size_t size) |
Write a record to a RecordIO object. More... | |
MXNET_DLL int | MXRecordIOWriterTell (RecordIOHandle handle, size_t *pos) |
Get the current writer pointer position. More... | |
MXNET_DLL int | MXRecordIOReaderCreate (const char *uri, RecordIOHandle *out) |
Create a RecordIO reader object. More... | |
MXNET_DLL int | MXRecordIOReaderFree (RecordIOHandle handle) |
Delete a RecordIO reader object. More... | |
MXNET_DLL int | MXRecordIOReaderReadRecord (RecordIOHandle handle, char const **buf, size_t *size) |
Write a record to a RecordIO object. More... | |
MXNET_DLL int | MXRecordIOReaderSeek (RecordIOHandle handle, size_t pos) |
Set the current reader pointer position. More... | |
MXNET_DLL int | MXRecordIOReaderTell (RecordIOHandle handle, size_t *pos) |
Get the current writer pointer position. More... | |
MXNET_DLL int | MXRtcCreate (char *name, uint32_t num_input, uint32_t num_output, char **input_names, char **output_names, NDArrayHandle *inputs, NDArrayHandle *outputs, char *kernel, RtcHandle *out) |
Create a MXRtc object. More... | |
MXNET_DLL int | MXRtcPush (RtcHandle handle, uint32_t num_input, uint32_t num_output, NDArrayHandle *inputs, NDArrayHandle *outputs, uint32_t gridDimX, uint32_t gridDimY, uint32_t gridDimZ, uint32_t blockDimX, uint32_t blockDimY, uint32_t blockDimZ) |
Run cuda kernel. More... | |
MXNET_DLL int | MXRtcFree (RtcHandle handle) |
Delete a MXRtc object. More... | |
MXNET_DLL int | MXCustomOpRegister (const char *op_type, CustomOpPropCreator creator) |
MXNET_DLL int | MXCustomFunctionRecord (int num_inputs, NDArrayHandle *inputs, int num_outputs, NDArrayHandle *outputs, struct MXCallbackList *callbacks) |
MXNET_DLL int | MXRtcCudaModuleCreate (const char *source, int num_options, const char **options, int num_exports, const char **exports, CudaModuleHandle *out) |
MXNET_DLL int | MXRtcCudaModuleFree (CudaModuleHandle handle) |
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 | MXRtcCudaKernelFree (CudaKernelHandle handle) |
MXNET_DLL int | MXRtcCudaKernelCall (CudaKernelHandle handle, int dev_id, void **args, uint32_t grid_dim_x, uint32_t grid_dim_y, uint32_t grid_dim_z, uint32_t block_dim_x, uint32_t block_dim_y, uint32_t block_dim_z, uint32_t shared_mem) |
MXNET_DLL int | MXNDArrayGetSharedMemHandle (NDArrayHandle handle, int *shared_pid, int *shared_id) |
Get shared memory handle from NDArray. More... | |
MXNET_DLL int | MXStorageEmptyCache (int dev_type, int dev_id) |
Release all unreferenced memory from the devices storage managers memory pool. More... | |
MXNET_DLL int | MXNDArrayCreateFromSharedMem (int shared_pid, int shared_id, const int *shape, int ndim, int dtype, NDArrayHandle *out) |
Reconstruct NDArray from shared memory handle. More... | |
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. More... | |
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. More... | |
MXNET_DLL int | MXShallowCopyNDArray (NDArrayHandle src, NDArrayHandle *out) |
Create an NDArray from source sharing the same data chunk. More... | |
MXNET_DLL int | MXShallowCopySymbol (SymbolHandle src, SymbolHandle *out) |
Create an Symbol from source sharing the same graph structure. More... | |
MXNET_DLL int | MXEnginePushAsyncND (EngineAsyncFunc async_func, void *func_param, EngineFuncParamDeleter deleter, ContextHandle ctx_handle, NDArrayHandle *const_nds_handle, int num_const_nds, NDArrayHandle *mutable_nds_handle, int num_mutable_nds, 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. More... | |
MXNET_DLL int | MXEnginePushSyncND (EngineSyncFunc sync_func, void *func_param, EngineFuncParamDeleter deleter, ContextHandle ctx_handle, NDArrayHandle *const_nds_handle, int num_const_nds, NDArrayHandle *mutable_nds_handle, int num_mutable_nds, EngineFnPropertyHandle prop_handle DEFAULT(NULL), int priority DEFAULT(0), const char *opr_name DEFAULT(NULL)) |
Push a synchronous operation to the engine. More... | |
MXNET_DLL int | MXCheckDynamicShapeOp (SymbolHandle sym_handle, bool *has_dynamic_shape) |
This function checks if any dynamic shape op is present in the symbol. More... | |
MXNET_DLL int | MXPushStreamDep (NDArrayHandle handle, int stream) |
Synchronize the consumer stream with the producer stream where the NDArray lives. More... | |
MXNET_DLL int | MXGetCurrentStream (int device_id, int *stream) |
Get current stream pointer based on current device type and id. More... | |
MXNET_DLL int | MXNVTXRangePush (const char *name, mx_uint color) |
Push a new NVTX range. Requires building with CUDA and NVTX. More... | |
MXNET_DLL int | MXNVTXRangePop () |
End the NVTX range. Requires building with CUDA and NVTX. More... | |
MXNET_DLL int | MXCUDAProfilerStart () |
Start CUDA profiling session. Requires building with CUDA and NVTX. More... | |
MXNET_DLL int | MXCUDAProfilerStop () |
End CUDA profiling session. Requires building with CUDA and NVTX. More... | |
MXNET_DLL int | MXSetOptimizeLayout (bool val) |
Turns on or off Layout Optimization. More... | |
MXNET_DLL int | MXGetOptimizeLayout (bool *val) |
Get current Layout Optimization status. More... | |
Variables | |
const typedef void * | FunctionHandle |
handle to a mxnet narray function that changes NDArray More... | |
const typedef void * | ContextHandle |
handle to Context More... | |
const typedef void * | EngineFnPropertyHandle |
handle to Engine FnProperty More... | |
C API of mxnet.
#define DEFAULT | ( | x | ) |
Inhibit C++ name-mangling for MXNet functions.
Keep the default value in C++
#define MXNDArrayCreateEx MXNDArrayCreate |
#define MXNET_BRANCH "NotProvided" |
#define MXNET_COMMIT_HASH "NotProvided" |
#define MXNET_DLL |
MXNET_DLL prefix for windows.
typedef void* AtomicSymbolCreator |
handle to a function that takes param and creates symbol
typedef void* AtomicSymbolHandle |
handle to a AtomicSymbol
typedef void* BatchifyFunctionCreator |
handle to a BatchifyFunction creator
typedef void* BatchifyFunctionHandle |
handle to a BatchifyFunction
typedef void* CachedOpHandle |
handle to cached operator
typedef void(* CachedOpMonitorCallback) (const char *, const char *, NDArrayHandle) |
Monitor callback called at operator level for cached op.
typedef void* CudaKernelHandle |
handle to rtc cuda kernel
typedef void* CudaModuleHandle |
handle to rtc cuda module
typedef int(* CustomFunctionBwdFunc) (int, int, void **, const int *, const int, void *) |
typedef int(* CustomFunctionDelFunc) (void *) |
typedef int(* CustomOpBackwardInferStorageTypeFunc) (int, int *, int *, void *) |
typedef int(* CustomOpBwdDepFunc) (const int *, const int *, const int *, int *, int **, void *) |
typedef int(* CustomOpCreateFunc) (const char *, int, unsigned **, const int *, const int *, struct MXCallbackList *, void *) |
typedef int(* CustomOpDelFunc) (void *) |
typedef int(* CustomOpFBFunc) (int, void **, int *, const int *, const int, void *) |
typedef int(* CustomOpInferShapeFunc) (int, int *, int **, void *) |
typedef int(* CustomOpInferStorageTypeFunc) (int, int *, void *) |
typedef int(* CustomOpInferTypeFunc) (int, int *, void *) |
typedef int(* CustomOpListFunc) (char ***, void *) |
typedef int(* CustomOpPropCreator) (const char *, const int, const char **, const char **, struct MXCallbackList *) |
typedef void* DataIterCreator |
handle a dataiter creator
typedef void* DataIterHandle |
handle to a DataIterator
typedef void* DatasetCreator |
handle a dataset creator
typedef void* DatasetHandle |
handle to a Dataset
typedef int64_t dim_t |
data type to store dim size
typedef void* DLManagedTensorHandle |
handle to DLManagedTensor
typedef void(* EngineAsyncFunc) (void *, void *, void *, void *) |
Engine asynchronous operation.
typedef void(* EngineFuncParamDeleter) (void *) |
Callback to free the param for EngineAsyncFunc/EngineSyncFunc.
typedef void(* EngineSyncFunc) (void *, void *) |
Engine synchronous operation.
typedef void* EngineVarHandle |
handle to Engine VarHandle
typedef void* ExecutorHandle |
handle to an Executor
typedef void* KVStoreHandle |
handle to KVStore
typedef float mx_float |
manually define float
typedef uint32_t mx_uint |
manually define unsigned int
typedef int(* MXGenericCallback) (void) |
typedef void() MXKVStoreServerController(int head, const char *body, void *controller_handle) |
the prototype of a server controller
head | the head of the command |
body | the body of the command |
controller_handle | helper handle for implementing controller |
typedef 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 recv and local
the | key |
recv | the pushed value on this key |
local | the value stored on local on this key |
handle | The additional handle to the updater |
typedef 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
the | key |
recv | the pushed value on this key |
local | the value stored on local on this key |
handle | The additional handle to the updater |
typedef void* NDArrayHandle |
handle to NDArray
typedef void* ProfileHandle |
handle to a Profile object (domain, duration, counter, etc.)
typedef void* RecordIOHandle |
handle to RecordIO
typedef void* RtcHandle |
handle to MXRtc
typedef void* SymbolHandle |
handle to a symbol that can be bind as operator
enum CustomOpCallbacks |
MXNET_DLL int MXAggregateProfileStatsPrint | ( | const char ** | out_str, |
int | reset, | ||
int | format, | ||
int | sort_by, | ||
int | ascending | ||
) |
Print sorted aggregate stats to the a string How aggregate stats are stored will not change.
out_str | will receive a pointer to the output string |
reset | clear the aggregate stats after printing |
format | whether to return in tabular or json format |
sort_by | sort by total, avg, min, max, or count |
ascending | whether to sort ascendingly |
MXNET_DLL int MXAutogradBackward | ( | uint32_t | num_output, |
NDArrayHandle * | output_handles, | ||
NDArrayHandle * | ograd_handles, | ||
int | retain_graph | ||
) |
compute the gradient of outputs w.r.t variabels
num_output | number of output NDArray |
output_handles | output NDArrays |
ograd_handles | head gradient for NDArrays |
retain_graph | whether to keep the graph after backward |
MXNET_DLL int MXAutogradBackwardEx | ( | uint32_t | num_output, |
NDArrayHandle * | output_handles, | ||
NDArrayHandle * | ograd_handles, | ||
uint32_t | 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
num_output | number of output NDArray |
output_handles | output NDArrays |
ograd_handles | head gradient for NDArrays |
num_variables | number of variables |
MXNET_DLL int MXAutogradComputeGradient | ( | uint32_t | num_output, |
NDArrayHandle * | output_handles | ||
) |
compute the gradient of outputs w.r.t variabels
num_output | number of output NDArray |
output_handles | output NDArrays |
MXNET_DLL int MXAutogradDropGrads | ( | uint32_t | num_var, |
NDArrayHandle * | var_handles | ||
) |
unmark nonleaf NDArrays to free the memory
num_var | number of variable NDArrays |
var_handles | variable NDArrays |
MXNET_DLL int MXAutogradGetSymbol | ( | NDArrayHandle | handle, |
SymbolHandle * | out | ||
) |
MXNET_DLL int MXAutogradIsRecording | ( | bool * | curr | ) |
get whether autograd recording is on
curr | returns the current status. |
MXNET_DLL int MXAutogradIsTraining | ( | bool * | curr | ) |
get whether training mode is on
curr | returns the current status. |
MXNET_DLL int MXAutogradMarkVariables | ( | uint32_t | num_var, |
NDArrayHandle * | var_handles, | ||
uint32_t * | reqs_array, | ||
NDArrayHandle * | grad_handles | ||
) |
mark NDArrays as variables to compute gradient for autograd
num_var | number of variable NDArrays |
var_handles | variable NDArrays |
MXNET_DLL int MXAutogradSetIsRecording | ( | int | is_recording, |
int * | prev | ||
) |
set whether to record operator for autograd
is_recording | 1 when recording, 0 when not recording. |
prev | returns the previous status before this set. |
MXNET_DLL int MXAutogradSetIsTraining | ( | int | is_training, |
int * | prev | ||
) |
set whether to record operator for autograd
is_training | 1 when training, 0 when testing |
prev | returns the previous status before this set. |
MXNET_DLL int MXBatchifyFunctionCreateFunction | ( | BatchifyFunctionCreator | handle, |
uint32_t | num_param, | ||
const char ** | keys, | ||
const char ** | vals, | ||
BatchifyFunctionHandle * | out | ||
) |
Init an batchify function, init with parameters the array size of passed in arguments.
handle | of the batchify function creator |
num_param | number of parameter |
keys | parameter keys |
vals | parameter values |
out | resulting batchify function |
MXNET_DLL int MXBatchifyFunctionFree | ( | BatchifyFunctionHandle | handle | ) |
Free the handle to the IO module.
handle | the handle pointer to the batchify function |
MXNET_DLL int MXBatchifyFunctionGetFunctionInfo | ( | BatchifyFunctionCreator | creator, |
const char ** | name, | ||
const char ** | description, | ||
uint32_t * | num_args, | ||
const char *** | arg_names, | ||
const char *** | arg_type_infos, | ||
const char *** | arg_descriptions | ||
) |
Get the detailed information about batchify function.
creator | the batchifyFunctionCreator. |
name | The returned name of the creator. |
description | The returned description of the symbol. |
num_args | Number of arguments. |
arg_names | Name of the arguments. |
arg_type_infos | Type informations about the arguments. |
arg_descriptions | Description information about the arguments. |
MXNET_DLL int MXBatchifyFunctionInvoke | ( | BatchifyFunctionHandle | handle, |
int | batch_size, | ||
int | num_output, | ||
NDArrayHandle * | inputs, | ||
NDArrayHandle ** | outputs | ||
) |
Invoke the Batchify Function.
handle | the handle pointer to the batchify function |
batch_size | the batch size |
num_output | the number of ndarrays for output |
inputs | the pointers to input ndarrays |
ouptuts | the pointers to output ndarrays |
MXNET_DLL int MXCachedOpGetOptimizedSymbol | ( | CachedOpHandle | handle, |
SymbolHandle * | out | ||
) |
get optimized graph from the cached op
MXNET_DLL int MXCachedOpRegisterOpHook | ( | CachedOpHandle | handle, |
CachedOpMonitorCallback | callback, | ||
bool | monitor_all | ||
) |
cached op set monitor callback
MXNET_DLL int MXCheckDynamicShapeOp | ( | SymbolHandle | sym_handle, |
bool * | has_dynamic_shape | ||
) |
This function checks if any dynamic shape op is present in the symbol.
sym_handle | handler of the input symbol. |
has_dynamic_shape | Flag to indicate if the symbol contains dynamic shape op. |
MXNET_DLL int MXCreateCachedOp | ( | SymbolHandle | handle, |
int | num_flags, | ||
const char ** | keys, | ||
const char ** | vals, | ||
CachedOpHandle * | out, | ||
bool thread_safe | DEFAULTfalse | ||
) |
create cached operator, allows to choose thread_safe version of cachedop
MXNET_DLL int MXCUDAProfilerStart | ( | ) |
Start CUDA profiling session. Requires building with CUDA and NVTX.
MXNET_DLL int MXCUDAProfilerStop | ( | ) |
End CUDA profiling session. Requires building with CUDA and NVTX.
MXNET_DLL int MXCustomFunctionRecord | ( | int | num_inputs, |
NDArrayHandle * | inputs, | ||
int | num_outputs, | ||
NDArrayHandle * | outputs, | ||
struct MXCallbackList * | callbacks | ||
) |
MXNET_DLL int MXCustomOpRegister | ( | const char * | op_type, |
CustomOpPropCreator | creator | ||
) |
MXNET_DLL int MXDataIterBeforeFirst | ( | DataIterHandle | handle | ) |
Call iterator.Reset.
handle | the handle to iterator |
MXNET_DLL int MXDataIterCreateIter | ( | DataIterCreator | handle, |
uint32_t | num_param, | ||
const char ** | keys, | ||
const char ** | vals, | ||
DataIterHandle * | out | ||
) |
Init an iterator, init with parameters the array size of passed in arguments.
handle | of the iterator creator |
num_param | number of parameter |
keys | parameter keys |
vals | parameter values |
out | resulting iterator |
MXNET_DLL int MXDataIterFree | ( | DataIterHandle | handle | ) |
Free the handle to the IO module.
handle | the handle pointer to the data iterator |
MXNET_DLL int MXDataIterGetData | ( | DataIterHandle | handle, |
NDArrayHandle * | out | ||
) |
Get the handle to the NDArray of underlying data.
handle | the handle pointer to the data iterator |
out | handle to underlying data NDArray |
MXNET_DLL int MXDataIterGetIndex | ( | DataIterHandle | handle, |
uint64_t ** | out_index, | ||
uint64_t * | out_size | ||
) |
Get the image index by array.
handle | the handle pointer to the data iterator |
out_index | output index of the array. |
out_size | output size of the array. |
MXNET_DLL int MXDataIterGetItems | ( | DataIterHandle | handle, |
int * | num_outputs, | ||
NDArrayHandle ** | outputs | ||
) |
Get the handles to specified underlying ndarrays of index.
handle | the handle pointer to the data iterator |
num_outputs | the length of outputs |
out | the handle to an array of NDArrays that stores pointers to handles |
MXNET_DLL int MXDataIterGetIterInfo | ( | DataIterCreator | creator, |
const char ** | name, | ||
const char ** | description, | ||
uint32_t * | num_args, | ||
const char *** | arg_names, | ||
const char *** | arg_type_infos, | ||
const char *** | arg_descriptions | ||
) |
Get the detailed information about data iterator.
creator | the DataIterCreator. |
name | The returned name of the creator. |
description | The returned description of the symbol. |
num_args | Number of arguments. |
arg_names | Name of the arguments. |
arg_type_infos | Type informations about the arguments. |
arg_descriptions | Description information about the arguments. |
MXNET_DLL int MXDataIterGetLabel | ( | DataIterHandle | handle, |
NDArrayHandle * | out | ||
) |
Get the handle to the NDArray of underlying label.
handle | the handle pointer to the data iterator |
out | the handle to underlying label NDArray |
MXNET_DLL int MXDataIterGetLenHint | ( | DataIterHandle | handle, |
int64_t * | len | ||
) |
Call iterator.GetLenHint. Note that some iterators don't provide length.
handle | the handle to iterator |
MXNET_DLL int MXDataIterGetPadNum | ( | DataIterHandle | handle, |
int * | pad | ||
) |
Get the padding number in current data batch.
handle | the handle pointer to the data iterator |
pad | pad number ptr |
MXNET_DLL int MXDataIterNext | ( | DataIterHandle | handle, |
int * | out | ||
) |
Move iterator to next position.
handle | the handle to iterator |
out | return value of next |
MXNET_DLL int MXDatasetCreateDataset | ( | DatasetCreator | handle, |
uint32_t | num_param, | ||
const char ** | keys, | ||
const char ** | vals, | ||
DatasetHandle * | out | ||
) |
Init an dataset, init with parameters the array size of passed in arguments.
handle | of the dataset creator |
num_param | number of parameter |
keys | parameter keys |
vals | parameter values |
out | resulting dataset |
MXNET_DLL int MXDatasetFree | ( | DatasetHandle | handle | ) |
Free the handle to the IO module.
handle | the handle pointer to the dataset |
MXNET_DLL int MXDatasetGetDatasetInfo | ( | DatasetCreator | creator, |
const char ** | name, | ||
const char ** | description, | ||
uint32_t * | num_args, | ||
const char *** | arg_names, | ||
const char *** | arg_type_infos, | ||
const char *** | arg_descriptions | ||
) |
Get the detailed information about dataset.
creator | the DatasetCreator. |
name | The returned name of the creator. |
description | The returned description of the symbol. |
num_args | Number of arguments. |
arg_names | Name of the arguments. |
arg_type_infos | Type informations about the arguments. |
arg_descriptions | Description information about the arguments. |
MXNET_DLL int MXDatasetGetItems | ( | DatasetHandle | handle, |
uint64_t | index, | ||
int * | num_outputs, | ||
NDArrayHandle ** | outputs | ||
) |
Get Output NDArray given specified indices.
handle | the handle to dataset |
index | the index of the dataset item to be retrieved |
num_outputs | the number of output ndarrays |
outputs | the pointers to handles of ndarrays |
is_scalar | if not zeros then output should be casted to scalars |
MXNET_DLL int MXDatasetGetLen | ( | DatasetHandle | handle, |
uint64_t * | out | ||
) |
Get dataset overal length(size)
handle | the handle to dataset |
out | return value of GetLen |
MXNET_DLL int MXDumpProcessProfile | ( | int | finished, |
int | profile_process, | ||
KVStoreHandle | kvStoreHandle | ||
) |
Save profile and stop profiler.
finished | true if stat output should stop after this point |
profile_process | an int, when 0 command is for worker/current process, when 1 command is for server process |
kvstoreHandle | handle to kvstore |
MXNET_DLL int MXDumpProfile | ( | int | finished | ) |
Save profile and stop profiler for worker/current process.
finished | true if stat output should stop after this point |
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 | DEFAULTNULL, | ||
int priority | DEFAULT0, | ||
const char *opr_name | DEFAULTNULL, | ||
bool wait | DEFAULTfalse | ||
) |
Push an asynchronous operation to the engine.
async_func | Execution function whici takes a parameter on_complete that must be called when the execution ompletes. |
func_param | The parameter set on calling async_func, can be NULL. |
deleter | The callback to free func_param, can be NULL. |
ctx_handle | Execution context. |
const_vars_handle | The variables that current operation will use but not mutate. |
num_const_vars | The number of const_vars_handle. |
mutable_vars_handle | The variables that current operation will mutate. |
num_mutable_vars | The number of mutable_vars_handle. |
prop_handle | Property of the function. |
priority | Priority of the action, as hint to the engine. |
opr_name | The operation name. |
wait | Whether this is a WaitForVar operation. |
MXNET_DLL int MXEnginePushAsyncND | ( | EngineAsyncFunc | async_func, |
void * | func_param, | ||
EngineFuncParamDeleter | deleter, | ||
ContextHandle | ctx_handle, | ||
NDArrayHandle * | const_nds_handle, | ||
int | num_const_nds, | ||
NDArrayHandle * | mutable_nds_handle, | ||
int | num_mutable_nds, | ||
EngineFnPropertyHandle prop_handle | DEFAULTNULL, | ||
int priority | DEFAULT0, | ||
const char *opr_name | DEFAULTNULL, | ||
bool wait | DEFAULTfalse | ||
) |
Push an asynchronous operation to the engine.
async_func | Execution function whici takes a parameter on_complete that must be called when the execution ompletes. |
func_param | The parameter set on calling async_func, can be NULL. |
deleter | The callback to free func_param, can be NULL. |
ctx_handle | Execution context. |
const_nds_handle | The NDArrays that current operation will use but not mutate. |
num_const_nds | The number of const_nds_handle. |
mutable_nds_handle | The NDArrays that current operation will mutate. |
num_mutable_nds | The number of mutable_nds_handle. |
prop_handle | Property of the function. |
priority | Priority of the action, as hint to the engine. |
opr_name | The operation name. |
wait | Whether this is a WaitForVar operation. |
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 | DEFAULTNULL, | ||
int priority | DEFAULT0, | ||
const char *opr_name | DEFAULTNULL | ||
) |
Push a synchronous operation to the engine.
sync_func | Execution function that executes the operation. |
func_param | The parameter set on calling sync_func, can be NULL. |
deleter | The callback to free func_param, can be NULL. |
ctx_handle | Execution context. |
const_vars_handle | The variables that current operation will use but not mutate. |
num_const_vars | The number of const_vars_handle. |
mutable_vars_handle | The variables that current operation will mutate. |
num_mutable_vars | The number of mutable_vars_handle. |
prop_handle | Property of the function. |
priority | Priority of the action, as hint to the engine. |
opr_name | The operation name. |
MXNET_DLL int MXEnginePushSyncND | ( | EngineSyncFunc | sync_func, |
void * | func_param, | ||
EngineFuncParamDeleter | deleter, | ||
ContextHandle | ctx_handle, | ||
NDArrayHandle * | const_nds_handle, | ||
int | num_const_nds, | ||
NDArrayHandle * | mutable_nds_handle, | ||
int | num_mutable_nds, | ||
EngineFnPropertyHandle prop_handle | DEFAULTNULL, | ||
int priority | DEFAULT0, | ||
const char *opr_name | DEFAULTNULL | ||
) |
Push a synchronous operation to the engine.
sync_func | Execution function that executes the operation. |
func_param | The parameter set on calling sync_func, can be NULL. |
deleter | The callback to free func_param, can be NULL. |
ctx_handle | Execution context. |
const_nds_handle | The NDArrays that current operation will use but not mutate. |
num_const_nds | The number of const_nds_handle. |
mutable_nds_handle | The NDArrays that current operation will mutate. |
num_mutable_nds | The number of mutable_nds_handle. |
prop_handle | Property of the function. |
priority | Priority of the action, as hint to the engine. |
opr_name | The operation name. |
MXNET_DLL int MXEngineSetBulkSize | ( | int | bulk_size, |
int * | prev_bulk_size | ||
) |
set bulk execution limit
bulk_size | new bulk_size |
prev_bulk_size | previous bulk_size |
MXNET_DLL int MXFreeCachedOp | ( | CachedOpHandle | handle | ) |
free cached operator
MXNET_DLL int MXFuncDescribe | ( | FunctionHandle | fun, |
uint32_t * | num_use_vars, | ||
uint32_t * | num_scalars, | ||
uint32_t * | num_mutate_vars, | ||
int * | type_mask | ||
) |
get the argument requirements of the function
fun | input function handle |
num_use_vars | how many NDArrays to be passed in as used_vars |
num_scalars | scalar variable is needed |
num_mutate_vars | how many NDArrays to be passed in as mutate_vars |
type_mask | the type mask of this function |
MXNET_DLL int MXFuncGetInfo | ( | FunctionHandle | fun, |
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 **return_type | DEFAULTNULL | ||
) |
Get the information of the function handle.
fun | The function handle. |
name | The returned name of the function. |
description | The returned description of the function. |
num_args | Number of arguments. |
arg_names | Name of the arguments. |
arg_type_infos | Type information about the arguments. |
arg_descriptions | Description information about the arguments. |
return_type | Return type of the function. |
MXNET_DLL int MXFuncInvoke | ( | FunctionHandle | fun, |
NDArrayHandle * | use_vars, | ||
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
fun | the function |
use_vars | the normal arguments passed to function |
scalar_args | the scalar qarguments |
mutate_vars | the mutate arguments |
num_params | number of keyword parameters |
param_keys | keys for keyword parameters |
param_vals | values for keyword parameters |
MXNET_DLL int MXGenAtomicSymbolFromSymbol | ( | SymbolHandle | sym_handle, |
SymbolHandle * | ret_sym_handle | ||
) |
Generate atomic symbol (able to be composed) from a source symbol.
sym_handle | source symbol |
ret_sym_handle | returned atomic symbol |
MXNET_DLL int MXGenBackendSubgraph | ( | SymbolHandle | sym_handle, |
const char * | backend, | ||
SymbolHandle * | ret_sym_handle | ||
) |
Run subgraph pass based on the backend provided.
sym_handle | symbol to be converted |
backend | backend names for subgraph pass |
ret_sym_handle | returned symbol |
MXNET_DLL int MXGetBranch | ( | const char ** | out | ) |
get the MXNet library branch at build time, usually provided by cmake
pointer | to the string holding the branch name |
MXNET_DLL int MXGetCommitHash | ( | const char ** | out | ) |
get the MXNet library commit hash at build time, usually provided by cmake
pointer | to the string holding the commit hash |
MXNET_DLL int MXGetCurrentStream | ( | int | device_id, |
int * | stream | ||
) |
Get current stream pointer based on current device type and id.
device_id | Current device id. |
stream | A pointer pointing to current stream. |
MXNET_DLL int MXGetFunction | ( | const char * | name, |
FunctionHandle * | out | ||
) |
get the function handle by name
name | the name of the function |
out | the corresponding function handle |
MXNET_DLL int MXGetGPUCount | ( | int * | out | ) |
Get the number of GPUs.
pointer | to int that will hold the number of GPUs available. |
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 instead.
dev | the GPU number to query |
free_mem | pointer to the integer holding free GPU memory |
total_mem | pointer to the integer holding total GPU memory |
MXNET_DLL int MXGetGPUMemoryInformation64 | ( | int | dev, |
uint64_t * | free_mem, | ||
uint64_t * | total_mem | ||
) |
get the free and total available memory on a GPU
dev | the GPU number to query |
free_mem | pointer to the uint64_t holding free GPU memory |
total_mem | pointer to the uint64_t holding total GPU memory |
const MXNET_DLL char* MXGetLastError | ( | ) |
return str message of the last error all function in this file will return 0 when success and -1 when an error occured, MXGetLastError can be called to retrieve the error
this function is threadsafe and can be called by different thread
MXNET_DLL int MXGetOptimizationConstraints | ( | unsigned int * | curr | ) |
get current optimization constraints
curr | returns the current status |
MXNET_DLL int MXGetOptimizeLayout | ( | bool * | val | ) |
Get current Layout Optimization status.
MXNET_DLL int MXGetVersion | ( | int * | out | ) |
get the MXNet library version as an integer
pointer | to the integer holding the version number |
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, | ||
const int ** | out_stypes | ||
) |
invoke a nnvm op and imperative function
creator | the op |
num_inputs | number of input NDArrays |
inputs | input NDArrays |
num_outputs | number of output NDArrays |
outputs | output NDArrays |
num_params | number of keyword parameters |
param_keys | keys for keyword parameters |
param_vals | values for keyword parameters |
out_stypes | output ndarrays' stypes |
MXNET_DLL int MXInitPSEnv | ( | uint32_t | num_vars, |
const char ** | keys, | ||
const char ** | vals | ||
) |
Initialized ps-lite environment variables.
num_vars | number of variables to initialize |
keys | environment keys |
vals | environment values |
MXNET_DLL int MXInvokeCachedOp | ( | CachedOpHandle | handle, |
int | num_inputs, | ||
NDArrayHandle * | inputs, | ||
int | default_dev_type, | ||
int | default_dev_id, | ||
int * | num_outputs, | ||
NDArrayHandle ** | outputs, | ||
const int ** | out_stypes | ||
) |
invoke a cached op
handle | the handle to the cached op |
num_inputs | number of input NDArrays |
inputs | input NDArrays |
num_outputs | number of output NDArrays |
default_dev_type | the default context type |
default_dev_id | the default context device id |
outputs | output NDArrays |
out_stypes | output ndarrays' stypes |
MXNET_DLL int MXIsNumpyDefaultDtype | ( | bool * | curr | ) |
get numpy default data type
curr | returns the current status |
MXNET_DLL int MXIsNumpyShape | ( | int * | curr | ) |
get whether numpy compatibility is on
curr | returns the current status |
MXNET_DLL int MXKVStoreBarrier | ( | KVStoreHandle | handle | ) |
global barrier among all worker machines
handle | handle to the KVStore |
MXNET_DLL int MXKVStoreBroadcast | ( | KVStoreHandle | handle, |
mx_uint | vnum, | ||
const int * | vkeys, | ||
mx_uint | onum, | ||
const int * | okeys, | ||
NDArrayHandle * | vals, | ||
NDArrayHandle * | outs, | ||
int | priority | ||
) |
broadcast a list of (key, value) pairs from the kvstore
handle | handle to the kvstore |
vnum | the number of key-value pairs corresponding to vkeys |
vkeys | the list of keys for the values to be pushed |
onum | the number of key-value pairs corresponding to okeys |
okeys | the list of keys for the values to be pulled |
vals | the list of values |
outs | the list of outputs |
priority | the priority of the action |
MXNET_DLL int MXKVStoreBroadcastEx | ( | KVStoreHandle | handle, |
mx_uint | vnum, | ||
const char ** | vkeys, | ||
mx_uint | onum, | ||
const char ** | okeys, | ||
NDArrayHandle * | vals, | ||
NDArrayHandle * | outs, | ||
int | priority | ||
) |
broadcast a list of (key, value) pairs from the kvstore, where each key is a string
handle | handle to the kvstore |
vnum | the number of key-value pairs corresponding to vkeys |
vkeys | the list of keys for the values to be pushed |
onum | the number of key-value pairs corresponding to okeys |
okeys | the list of keys for the values to be pulled |
vals | the list of values |
outs | the list of outputs |
priority | the priority of the action |
MXNET_DLL int MXKVStoreCreate | ( | const char * | type, |
KVStoreHandle * | out | ||
) |
Create a kvstore.
type | the type of KVStore |
out | The output type of KVStore |
MXNET_DLL int MXKVStoreFree | ( | KVStoreHandle | handle | ) |
Delete a KVStore handle.
handle | handle to the kvstore |
MXNET_DLL int MXKVStoreGetGroupSize | ( | KVStoreHandle | handle, |
int * | ret | ||
) |
return The number of nodes in this group, which is
IsWorkerNode() == true
,IsServerNode() == true
,IsSchedulerNode() == true
, handle | handle to the KVStore |
ret | the group size |
MXNET_DLL int MXKVStoreGetNumDeadNode | ( | KVStoreHandle | handle, |
const int | node_id, | ||
int * | number, | ||
const int timeout_sec | DEFAULT60 | ||
) |
Get the number of ps dead node(s) specified by {node_id}.
handle | handle to the KVStore |
node_id | Can be a node group or a single node. kScheduler = 1, kServerGroup = 2, kWorkerGroup = 4 |
number | Ouptut number of dead nodes |
timeout_sec | A node fails to send heartbeart in {timeout_sec} seconds will be presumed as 'dead' |
MXNET_DLL int MXKVStoreGetRank | ( | KVStoreHandle | handle, |
int * | ret | ||
) |
return The rank of this node in its group, which is in [0, GroupSize).
handle | handle to the KVStore |
ret | the node rank |
MXNET_DLL int MXKVStoreGetType | ( | KVStoreHandle | handle, |
const char ** | type | ||
) |
get the type of the kvstore
handle | handle to the KVStore |
type | a string type |
MXNET_DLL int MXKVStoreInit | ( | KVStoreHandle | handle, |
uint32_t | num, | ||
const int * | keys, | ||
NDArrayHandle * | vals | ||
) |
Init a list of (key,value) pairs in kvstore.
handle | handle to the kvstore |
num | the number of key-value pairs |
keys | the list of keys |
vals | the list of values |
MXNET_DLL int MXKVStoreInitEx | ( | KVStoreHandle | handle, |
uint32_t | num, | ||
const char ** | keys, | ||
NDArrayHandle * | vals | ||
) |
Init a list of (key,value) pairs in kvstore, where each key is a string.
handle | handle to the kvstore |
num | the number of key-value pairs |
keys | the list of keys |
vals | the list of values |
MXNET_DLL int MXKVStoreIsSchedulerNode | ( | int * | ret | ) |
return whether or not this process is a scheduler node.
ret | 1 for yes, 0 for no |
MXNET_DLL int MXKVStoreIsServerNode | ( | int * | ret | ) |
return whether or not this process is a server node.
ret | 1 for yes, 0 for no |
MXNET_DLL int MXKVStoreIsWorkerNode | ( | int * | ret | ) |
return whether or not this process is a worker node.
ret | 1 for yes, 0 for no |
MXNET_DLL int MXKVStorePull | ( | KVStoreHandle | handle, |
uint32_t | num, | ||
const int * | keys, | ||
NDArrayHandle * | vals, | ||
int | priority | ||
) |
pull a list of (key, value) pairs from the kvstore
handle | handle to the kvstore |
num | the number of key-value pairs |
keys | the list of keys |
vals | the list of values |
priority | the priority of the action |
MXNET_DLL int MXKVStorePullEx | ( | KVStoreHandle | handle, |
uint32_t | num, | ||
const char ** | keys, | ||
NDArrayHandle * | vals, | ||
int | priority | ||
) |
pull a list of (key, value) pairs from the kvstore, where each key is a string
handle | handle to the kvstore |
num | the number of key-value pairs |
keys | the list of keys |
vals | the list of values |
priority | the priority of the action |
MXNET_DLL int MXKVStorePullRowSparse | ( | KVStoreHandle | handle, |
uint32_t | 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 back will be in row_sparse storage with only the specified row_ids present based row_ids (others rows are zeros).
handle | handle to the kvstore |
num | the number of key-value pairs |
keys | the list of keys |
vals | the list of values |
row_ids | the list of row_id NDArrays |
priority | the priority of the action |
MXNET_DLL int MXKVStorePullRowSparseEx | ( | KVStoreHandle | handle, |
uint32_t | 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 back will be in row_sparse storage with only the specified row_ids present based row_ids (others rows are zeros).
handle | handle to the kvstore |
num | the number of key-value pairs |
keys | the list of keys |
vals | the list of values |
row_ids | the list of row_id NDArrays |
priority | the priority of the action |
MXNET_DLL int MXKVStorePullWithSparse | ( | KVStoreHandle | handle, |
uint32_t | num, | ||
const int * | keys, | ||
NDArrayHandle * | vals, | ||
int | priority, | ||
bool | ignore_sparse | ||
) |
pull a list of (key, value) pairs from the kvstore
handle | handle to the kvstore |
num | the number of key-value pairs |
keys | the list of keys |
vals | the list of values |
priority | the priority of the action |
ignore_sparse | whether to ignore sparse arrays in the request |
MXNET_DLL int MXKVStorePullWithSparseEx | ( | KVStoreHandle | handle, |
uint32_t | 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
handle | handle to the kvstore |
num | the number of key-value pairs |
keys | the list of keys |
vals | the list of values |
priority | the priority of the action |
ignore_sparse | whether to ignore sparse arrays in the request |
MXNET_DLL int MXKVStorePush | ( | KVStoreHandle | handle, |
uint32_t | num, | ||
const int * | keys, | ||
NDArrayHandle * | vals, | ||
int | priority | ||
) |
Push a list of (key,value) pairs to kvstore.
handle | handle to the kvstore |
num | the number of key-value pairs |
keys | the list of keys |
vals | the list of values |
priority | the priority of the action |
MXNET_DLL int MXKVStorePushEx | ( | KVStoreHandle | handle, |
uint32_t | num, | ||
const char ** | keys, | ||
NDArrayHandle * | vals, | ||
int | priority | ||
) |
Push a list of (key,value) pairs to kvstore, where each key is a string.
handle | handle to the kvstore |
num | the number of key-value pairs |
keys | the list of keys |
vals | the list of values |
priority | the priority of the action |
MXNET_DLL int MXKVStorePushPull | ( | KVStoreHandle | handle, |
mx_uint | vnum, | ||
const int * | vkeys, | ||
mx_uint | onum, | ||
const int * | okeys, | ||
NDArrayHandle * | vals, | ||
NDArrayHandle * | outs, | ||
int | priority | ||
) |
push and pull a list of (key, value) pairs from the kvstore
handle | handle to the kvstore |
vnum | the number of key-value pairs corresponding to vkeys |
vkeys | the list of keys for the values to be pushed |
onum | the number of key-value pairs corresponding to okeys |
okeys | the list of keys for the values to be pulled |
vals | the list of values |
outs | the list of outputs |
priority | the priority of the action |
MXNET_DLL int MXKVStorePushPullEx | ( | KVStoreHandle | handle, |
mx_uint | vnum, | ||
const char ** | vkeys, | ||
mx_uint | onum, | ||
const char ** | okeys, | ||
NDArrayHandle * | vals, | ||
NDArrayHandle * | outs, | ||
int | priority | ||
) |
push and pull a list of (key, value) pairs from the kvstore, where each key is a string
handle | handle to the kvstore |
vnum | the number of key-value pairs corresponding to vkeys |
vkeys | the list of keys for the values to be pushed |
onum | the number of key-value pairs corresponding to okeys |
okeys | the list of keys for the values to be pulled |
vals | the list of values |
outs | the list of outputs |
priority | the priority of the action |
MXNET_DLL int MXKVStoreRunServer | ( | KVStoreHandle | handle, |
MXKVStoreServerController | controller, | ||
void * | controller_handle | ||
) |
Run as server (or scheduler)
handle | handle to the KVStore |
controller | the user-defined server controller |
controller_handle | helper handle for implementing controller |
MXNET_DLL int MXKVStoreSendCommmandToServers | ( | KVStoreHandle | handle, |
int | cmd_id, | ||
const char * | cmd_body | ||
) |
Send a command to all server nodes.
handle | handle to the KVStore |
cmd_id | the head of the command |
cmd_body | the body of the command |
MXNET_DLL int MXKVStoreSetBarrierBeforeExit | ( | KVStoreHandle | handle, |
const int | barrier_before_exit | ||
) |
whether to do barrier when finalize
handle | handle to the KVStore |
barrier_before_exit | whether to do barrier when kvstore finalize |
MXNET_DLL int MXKVStoreSetGradientCompression | ( | KVStoreHandle | handle, |
uint32_t | num_params, | ||
const char ** | keys, | ||
const char ** | vals | ||
) |
Set parameters to use low-bit compressed gradients.
handle | handle to the kvstore |
keys | keys for compression parameters |
vals | values for compression parameters |
MXNET_DLL int MXKVStoreSetUpdater | ( | KVStoreHandle | handle, |
MXKVStoreUpdater | updater, | ||
void * | updater_handle | ||
) |
register a push updater
handle | handle to the KVStore |
updater | udpater function |
updater_handle | The additional handle used to invoke the updater |
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
handle | handle to the KVStore |
updater | updater function with int keys |
str_updater | updater function with string keys |
updater_handle | The additional handle used to invoke the updater |
MXNET_DLL int MXLibInfoCompiledWithCXX11ABI | ( | int * | result | ) |
return whether the mxnet library is compiled with cxx11 abi
MXNET_DLL int MXLibInfoFeatures | ( | const struct LibFeature ** | libFeature, |
size_t * | size | ||
) |
Get list of features supported on the runtime.
libFeature | pointer to array of LibFeature |
size | of the array |
MXNET_DLL int MXListAllOpNames | ( | uint32_t * | out_size, |
const char *** | out_array | ||
) |
list all the available operator names, include entries.
out_size | the size of returned array |
out_array | the output operator name array. |
MXNET_DLL int MXListBatchifyFunctions | ( | uint32_t * | out_size, |
BatchifyFunctionCreator ** | out_array | ||
) |
List all the available batchify function entries.
out_size | the size of returned batchify functions |
out_array | the output batchify function entries |
MXNET_DLL int MXListDataIters | ( | uint32_t * | out_size, |
DataIterCreator ** | out_array | ||
) |
List all the available iterator entries.
out_size | the size of returned iterators |
out_array | the output iteratos entries |
MXNET_DLL int MXListDatasets | ( | uint32_t * | out_size, |
DatasetCreator ** | out_array | ||
) |
List all the available dataset entries.
out_size | the size of returned datasets |
out_array | the output dataset entries |
MXNET_DLL int MXListFunctions | ( | uint32_t * | out_size, |
FunctionHandle ** | out_array | ||
) |
list all the available functions handles most user can use it to list all the needed functions
out_size | the size of returned array |
out_array | the output function array |
MXNET_DLL int MXLoadLib | ( | const char * | path, |
unsigned | verbose, | ||
void ** | lib | ||
) |
Load library dynamically.
path | to the library .so file |
0 | for quiet, 1 for verbose |
MXNET_DLL int MXNDArrayAt | ( | NDArrayHandle | handle, |
uint32_t | idx, | ||
NDArrayHandle * | out | ||
) |
Index the NDArray along axis 0. This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default)
handle | the handle to the NDArray |
idx | the index |
out | The NDArrayHandle of output NDArray |
MXNET_DLL int MXNDArrayAt64 | ( | NDArrayHandle | handle, |
int64_t | idx, | ||
NDArrayHandle * | out | ||
) |
Index the NDArray along axis 0. This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support.
handle | the handle to the NDArray |
idx | the index |
out | The NDArrayHandle of output NDArray |
MXNET_DLL int MXNDArrayCallDLPackDeleter | ( | DLManagedTensorHandle | dlpack | ) |
Delete a dlpack tensor.
dlpack | the pointer of the input DLManagedTensor |
MXNET_DLL int MXNDArrayClearDeferredCompute | ( | NDArrayHandle * | arrays, |
int | num | ||
) |
Clear the deferred compute info associated with the ndarrays.
arrays | ndarray handles of deferred compute outputs |
num | number of ndarrays |
MXNET_DLL int MXNDArrayCreate | ( | const uint32_t * | shape, |
uint32_t | ndim, | ||
int | dev_type, | ||
int | dev_id, | ||
int | delay_alloc, | ||
int | dtype, | ||
NDArrayHandle * | out | ||
) |
create a NDArray with specified shape and data type This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default)
shape | the pointer to the shape |
ndim | the dimension of the shape |
dev_type | device type, specify device we want to take |
dev_id | the device id of the specific device |
delay_alloc | whether to delay allocation until the narray is first mutated |
dtype | data type of created array |
out | the returning handle |
MXNET_DLL int MXNDArrayCreate64 | ( | const int64_t * | shape, |
int | ndim, | ||
int | dev_type, | ||
int | dev_id, | ||
int | delay_alloc, | ||
int | dtype, | ||
NDArrayHandle * | out | ||
) |
create a NDArray with specified shape and data type This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support
shape | the pointer to int64_t shape |
ndim | the dimension of the shape |
dev_type | device type, specify device we want to take |
dev_id | the device id of the specific device |
delay_alloc | whether to delay allocation until the narray is first mutated |
dtype | data type of created array |
out | the returning handle |
MXNET_DLL int MXNDArrayCreateFromSharedMem | ( | int | shared_pid, |
int | shared_id, | ||
const int * | shape, | ||
int | ndim, | ||
int | dtype, | ||
NDArrayHandle * | out | ||
) |
Reconstruct NDArray from shared memory handle.
shared_pid | shared PID |
shared_id | shared memory id |
shape | pointer to NDArray dimensions |
ndim | number of NDArray dimensions |
dtype | data type of NDArray |
out | constructed NDArray |
MXNET_DLL int MXNDArrayCreateNone | ( | NDArrayHandle * | out | ) |
Load TVM operator from the binary library.
libpath | TVM operators lib file |
create a NDArray handle that is not initialized can be used to pass in as mutate variables to hold the result of NDArray
out | the returning handle |
MXNET_DLL int MXNDArrayCreateSparseEx | ( | int | storage_type, |
const uint32_t * | shape, | ||
uint32_t | ndim, | ||
int | dev_type, | ||
int | dev_id, | ||
int | delay_alloc, | ||
int | dtype, | ||
uint32_t | num_aux, | ||
int * | aux_type, | ||
uint32_t * | aux_ndims, | ||
const uint32_t * | aux_shape, | ||
NDArrayHandle * | out | ||
) |
create an empty sparse NDArray with specified shape and data type This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default)
storage_type | the storage type of the ndarray |
shape | the pointer to the shape |
ndim | the dimension of the shape |
dev_type | device type, specify device we want to take |
dev_id | the device id of the specific device |
delay_alloc | whether to delay allocation until the narray is first mutated |
dtype | data type of created array |
num_aux | the number of aux data to support this ndarray |
aux_type | data type of the aux data for the created array |
aux_ndims | the dimension of the shapes of aux data |
aux_shape | the shapes of aux data |
out | the returning handle |
MXNET_DLL int MXNDArrayCreateSparseEx64 | ( | int | storage_type, |
const int64_t * | shape, | ||
int | ndim, | ||
int | dev_type, | ||
int | dev_id, | ||
int | delay_alloc, | ||
int | dtype, | ||
uint32_t | num_aux, | ||
int * | aux_type, | ||
int * | aux_ndims, | ||
const int64_t * | aux_shape, | ||
NDArrayHandle * | out | ||
) |
create an empty sparse NDArray with specified shape and data type This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support
storage_type | the storage type of the ndarray |
shape | the pointer to the shape |
ndim | the dimension of the shape |
dev_type | device type, specify device we want to take |
dev_id | the device id of the specific device |
delay_alloc | whether to delay allocation until the narray is first mutated |
dtype | data type of created array |
num_aux | the number of aux data to support this ndarray |
aux_type | data type of the aux data for the created array |
aux_ndims | the dimension of the shapes of aux data |
aux_shape | the shapes of aux data |
out | the returning handle |
MXNET_DLL int MXNDArrayDetach | ( | NDArrayHandle | handle, |
NDArrayHandle * | out | ||
) |
detach and ndarray from computation graph by clearing entry_
handle | NDArray handle |
MXNET_DLL int MXNDArrayFree | ( | NDArrayHandle | handle | ) |
free the narray handle
handle | the handle to be freed |
MXNET_DLL int MXNDArrayFromDLPack | ( | DLManagedTensorHandle | dlpack, |
const bool | transient_handle, | ||
NDArrayHandle * | out_handle | ||
) |
Create a NDArray backed by a dlpack tensor.
This allows us to create a NDArray using the memory allocated by an external deep learning framework that is DLPack compatible.
The memory is retained until the NDArray went out of scope.
dlpack | the pointer of the input DLManagedTensor |
transient_handle | whether the handle will be destructed before calling the deleter |
out_handle | pointer holder to get pointer of NDArray |
MXNET_DLL int MXNDArrayGetAuxNDArray | ( | NDArrayHandle | handle, |
uint32_t | i, | ||
NDArrayHandle * | out | ||
) |
Get a deep copy of the ith aux data blob This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default) in the form of an NDArray of default storage type. This function blocks. Do not use it in performance critical code.
MXNET_DLL int MXNDArrayGetAuxNDArray64 | ( | NDArrayHandle | handle, |
int64_t | i, | ||
NDArrayHandle * | out | ||
) |
Get a deep copy of the ith aux data blob This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support in the form of an NDArray of default storage type. This function blocks. Do not use it in performance critical code.
MXNET_DLL int MXNDArrayGetAuxType | ( | NDArrayHandle | handle, |
uint32_t | i, | ||
int * | out_type | ||
) |
get the type of the ith aux data in NDArray This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default)
handle | the handle to the narray |
i | the index of the aux data |
out_type | pointer holder to get type of aux data |
MXNET_DLL int MXNDArrayGetAuxType64 | ( | NDArrayHandle | handle, |
int64_t | i, | ||
int * | out_type | ||
) |
get the type of the ith aux data in NDArray This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support
handle | the handle to the narray |
i | the index of the aux data |
out_type | pointer holder to get type of aux data |
MXNET_DLL int MXNDArrayGetContext | ( | NDArrayHandle | handle, |
int * | out_dev_type, | ||
int * | out_dev_id | ||
) |
get the context of the NDArray
handle | the handle to the narray |
out_dev_type | the output device type |
out_dev_id | the output device id |
MXNET_DLL int MXNDArrayGetData | ( | NDArrayHandle | handle, |
void ** | out_pdata | ||
) |
get the content of the data in NDArray
handle | the handle to the ndarray |
out_pdata | pointer holder to get pointer of data |
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 MXNDArrayGetDeferredComputeSymbol | ( | NDArrayHandle * | output_handles, |
int | num_outputs, | ||
SymbolHandle * | out | ||
) |
Convert the graph constructed during deferred computation mode to a Symbol.
output_handles | ndarray handles of outputs |
out | grouped output symbol handle |
Construct a Symbol for the deferred computation graph. output_handles specifies the outputs of interest which the returned symbol will compute.
MXNET_DLL int MXNDArrayGetDType | ( | NDArrayHandle | handle, |
int * | out_dtype | ||
) |
get the type of the data in NDArray
handle | the handle to the narray |
out_dtype | pointer holder to get type of data |
MXNET_DLL int MXNDArrayGetGrad | ( | NDArrayHandle | handle, |
NDArrayHandle * | out | ||
) |
return gradient buffer attached to this NDArray
handle | NDArray handle |
MXNET_DLL int MXNDArrayGetGradState | ( | NDArrayHandle | handle, |
int * | out | ||
) |
set the flag for gradient array state.
handle | NDArray handle |
state | the new state. |
MXNET_DLL int MXNDArrayGetShape | ( | NDArrayHandle | handle, |
int * | out_dim, | ||
const int ** | out_pdata | ||
) |
get the shape of the array This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default)
handle | the handle to the narray |
out_dim | the output dimension |
out_pdata | pointer holder to get data pointer of the shape |
MXNET_DLL int MXNDArrayGetShape64 | ( | NDArrayHandle | handle, |
int * | out_dim, | ||
const int64_t ** | out_pdata | ||
) |
get the shape of the array This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support
handle | the handle to the narray |
out_dim | the output dimension |
out_pdata | pointer holder to get data pointer of the shape |
MXNET_DLL int MXNDArrayGetSharedMemHandle | ( | NDArrayHandle | handle, |
int * | shared_pid, | ||
int * | shared_id | ||
) |
Get shared memory handle from NDArray.
handle | NDArray handle. |
shared_pid | output PID |
shared_id | output shared memory id. |
MXNET_DLL int MXNDArrayGetStorageType | ( | NDArrayHandle | handle, |
int * | out_storage_type | ||
) |
get the storage type of the array
MXNET_DLL int MXNDArrayIsDeferredCompute | ( | int * | curr | ) |
Get current status of deferred compute mode.
curr | returns the current status. |
MXNET_DLL int MXNDArrayLegacySave | ( | const char * | fname, |
uint32_t | num_args, | ||
NDArrayHandle * | args, | ||
const char ** | keys | ||
) |
Save list of narray into the file.
fname | name of the file. |
num_args | number of arguments to save. |
args | the array of NDArrayHandles to be saved. |
keys | the name of the NDArray, optional, can be NULL |
MXNET_DLL int MXNDArrayLoad | ( | const char * | fname, |
uint32_t * | out_size, | ||
NDArrayHandle ** | out_arr, | ||
uint32_t * | out_name_size, | ||
const char *** | out_names | ||
) |
Load list of narray from the file.
fname | name of the file. |
out_size | number of narray loaded. |
out_arr | head of the returning narray handles. |
out_name_size | size of output name arrray. |
out_names | the names of returning NDArrays, can be NULL |
MXNET_DLL int MXNDArrayLoadFromBuffer | ( | const void * | ndarray_buffer, |
size_t | size, | ||
uint32_t * | out_size, | ||
NDArrayHandle ** | out_arr, | ||
uint32_t * | out_name_size, | ||
const char *** | out_names | ||
) |
Load list / dictionary of narrays from file content loaded into memory. This will load a list of ndarrays in a similar manner to MXNDArrayLoad, however, it loads from buffer containing the contents of a file, rather than from a specified file.
ndarray_buffer | pointer to the start of the ndarray file content |
size | size of the file |
out_size | number of narray loaded. |
out_arr | head of the returning narray handles. |
out_name_size | size of output name arrray. |
out_names | the names of returning NDArrays, can be NULL |
MXNET_DLL int MXNDArrayLoadFromRawBytes | ( | const void * | buf, |
size_t | size, | ||
NDArrayHandle * | out | ||
) |
create a NDArray handle that is loaded from raw bytes.
buf | the head of the raw bytes |
size | size of the raw bytes |
out | the returning handle |
MXNET_DLL int MXNDArrayReshape | ( | NDArrayHandle | handle, |
int | ndim, | ||
int * | dims, | ||
NDArrayHandle * | out | ||
) |
Reshape the NDArray.
handle | the handle to the narray |
ndim | number of dimensions of new shape |
dims | new shape |
out | the NDArrayHandle of reshaped NDArray |
MXNET_DLL int MXNDArrayReshape64 | ( | NDArrayHandle | handle, |
int | ndim, | ||
dim_t * | dims, | ||
bool | reverse, | ||
NDArrayHandle * | out | ||
) |
Reshape the NDArray.
handle | the handle to the narray |
ndim | number of dimensions of new shape |
dims | new shape |
out | the NDArrayHandle of reshaped NDArray |
MXNET_DLL int MXNDArraySave | ( | const char * | fname, |
uint32_t | num_args, | ||
NDArrayHandle * | args, | ||
const char ** | keys | ||
) |
Save list of narray into the file.
fname | name of the file. |
num_args | number of arguments to save. |
args | the array of NDArrayHandles to be saved. |
keys | the name of the NDArray, optional, can be NULL |
MXNET_DLL int MXNDArraySaveRawBytes | ( | NDArrayHandle | handle, |
size_t * | out_size, | ||
const char ** | out_buf | ||
) |
save the NDArray into raw bytes.
handle | the NDArray handle |
out_size | size of the raw bytes |
out_buf | the head of returning memory bytes. |
MXNET_DLL int MXNDArraySetDeferredComputeVariable | ( | NDArrayHandle * | arrays, |
SymbolHandle * | variables, | ||
int | num | ||
) |
Associate variables with deferred compute arrays.
arrays | ndarray handles to be matched with variables |
variables | symbol handles of variables to be matched with ndarrays |
num | number of arrays and variables respectively |
MXNET_DLL int MXNDArraySetGradState | ( | NDArrayHandle | handle, |
int | state | ||
) |
set the flag for gradient array state.
handle | NDArray handle |
state | the new state. |
MXNET_DLL int MXNDArraySetIsDeferredCompute | ( | int | deferred_compute_enabled, |
int * | prev | ||
) |
set whether to enable deferred compute mode
deferred_compute_enabled | 1 to enable, 0 to disable. |
prev | returns the previous status before this set. |
MXNET_DLL int MXNDArraySlice | ( | NDArrayHandle | handle, |
uint32_t | slice_begin, | ||
uint32_t | slice_end, | ||
NDArrayHandle * | out | ||
) |
Slice the NDArray along axis 0. This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default)
handle | the handle to the NDArray |
slice_begin | The beginning index of slice |
slice_end | The ending index of slice |
out | The NDArrayHandle of sliced NDArray |
MXNET_DLL int MXNDArraySlice64 | ( | NDArrayHandle | handle, |
int64_t | slice_begin, | ||
int64_t | slice_end, | ||
NDArrayHandle * | out | ||
) |
Slice the NDArray along axis 0. This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support.
handle | the handle to the NDArray |
slice_begin | The beginning index of slice |
slice_end | The ending index of slice |
out | The NDArrayHandle of sliced NDArray |
MXNET_DLL int MXNDArraySyncCheckFormat | ( | NDArrayHandle | handle, |
const bool | full_check | ||
) |
check whether the NDArray format is valid
full_check | if True , rigorous check, O(N) operations Otherwise basic check, O(1) operations |
MXNET_DLL int MXNDArraySyncCopyFromCPU | ( | NDArrayHandle | handle, |
const void * | data, | ||
size_t | size | ||
) |
Perform a synchronize copy from a contiguous CPU memory region.
This function will call WaitToWrite before the copy is performed. This is useful to copy data from existing memory region that are not wrapped by NDArray(thus dependency not being tracked).
handle | the NDArray handle |
data | the data source to copy from. |
size | the memory size we want to copy from. |
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. Do not use it in performance critical code.
handle_dst | handle of a dst ndarray whose data/aux_data has been allocated |
handle_src | handle of a src ndarray which has default storage type |
i | dst data blob indicator |
MXNET_DLL int MXNDArraySyncCopyToCPU | ( | NDArrayHandle | handle, |
void * | data, | ||
size_t | size | ||
) |
Perform a synchronize copyto a contiguous CPU memory region.
This function will call WaitToRead before the copy is performed. This is useful to copy data from existing memory region that are not wrapped by NDArray(thus dependency not being tracked).
handle | the NDArray handle |
data | the data source to copy into. |
size | the memory size we want to copy into. |
MXNET_DLL int MXNDArrayToDLPack | ( | NDArrayHandle | handle, |
DLManagedTensorHandle * | out_dlpack | ||
) |
Create a reference view of NDArray that represents as DLManagedTensor Notice: MXNet uses asynchronous execution. Please call MXNDArrayWaitToRead or MXNDArrayWaitToWrite before calling MXNDArrayToDLPack.
handle | the handle to the ndarray |
out_dlpack | pointer holder to get pointer of DLManagedTensor |
MXNET_DLL int MXNDArrayWaitAll | ( | ) |
wait until all delayed operations in the system is completed
MXNET_DLL int MXNDArrayWaitToRead | ( | NDArrayHandle | handle | ) |
Wait until all the pending writes with respect NDArray are finished. Always call this before read data out synchronizely.
handle | the NDArray handle |
MXNET_DLL int MXNDArrayWaitToWrite | ( | NDArrayHandle | handle | ) |
Wait until all the pending read/write with respect NDArray are finished. Always call this before write data into NDArray synchronizely.
handle | the NDArray handle |
MXNET_DLL int MXNotifyShutdown | ( | ) |
Notify the engine about a shutdown, This can help engine to print less messages into display.
User do not have to call this function.
MXNET_DLL int MXNVTXRangePop | ( | ) |
End the NVTX range. Requires building with CUDA and NVTX.
Push a new NVTX range. Requires building with CUDA and NVTX.
name | Name of the range. |
color | Color used to display the range in the visual profiling tools. Encoded as 256*256*R + 256*G + B. |
MXNET_DLL int MXOptimizeForBackend | ( | SymbolHandle | sym_handle, |
const char * | backend_name, | ||
const int | dev_type, | ||
SymbolHandle * | ret_sym_handle, | ||
const mx_uint | args_len, | ||
NDArrayHandle * | in_args_handle, | ||
const mx_uint | aux_len, | ||
NDArrayHandle * | in_aux_handle, | ||
const mx_uint | num_options, | ||
const char ** | keys, | ||
const char ** | vals, | ||
const uint32_t | num_input_shapes, | ||
const char ** | input_shape_names, | ||
const int64_t * | input_shape_data, | ||
const uint32_t * | input_shape_idx, | ||
const uint32_t | num_input_dtypes, | ||
const char ** | input_dtype_names, | ||
const int * | input_dtypes, | ||
const uint32_t | num_input_stypes, | ||
const char ** | input_stype_names, | ||
const int * | input_stypes, | ||
bool | skip_infer, | ||
int * | new_args_cnt, | ||
NDArrayHandle ** | new_args_handle, | ||
char *** | new_arg_names_handle, | ||
int * | new_aux_cnt, | ||
NDArrayHandle ** | new_aux_handle, | ||
char *** | new_aux_names_handle | ||
) |
Partitions symbol for given backend, potentially creating subgraphs.
sym_handle | symbol to be partitioned |
dev_type | context device type |
backend_name | backend name |
ret_sym_handle | partitioned symbol returned |
len | number of args |
in_args_handle | args array |
num_options | number of key value pairs |
keys | keys for options |
vals | values corresponding to keys |
num_input_shapes | number of input shapes |
input_shape_names | names of the input shapes |
input_shape_data | pointer to the contiguous data shapes |
input_shape_idx | array of per shape starting idx, the shape length for the i-th input shape is calculate as input_shape_idx[i+1] - input_shape_idx[i] |
num_input_dtypes | number of input data types |
input_dtype_names | array of names of the input data types |
input_dtypes | array of values of the input data types |
num_input_stypesnumber | of input storage types |
input_stype_names | array of names of the input storage types |
input_stypes | array of values of input storage types |
skip_infer | if the optimization should skip the attribute inferences (to use if the backend does not require shape inference) |
new_args_cnt | pointer a number to store the number of new args |
new_args_handle | pointer on array to store the new args handles |
new_arg_names_handle | pointer on array to store the new args names |
new_aux_cnt | pointer a number to store the number of new aux |
new_aux_handle | pointer on array to store the new aux handles |
new_aux_names_handle | pointer on array to store the new aux names |
MXNET_DLL int MXProcessProfilePause | ( | int | paused, |
int | profile_process, | ||
KVStoreHandle | kvStoreHandle | ||
) |
Pause profiler tuning collection.
paused | If nonzero, profiling pauses. Otherwise, profiling resumes/continues |
profile_process | integer which denotes whether to process worker or server process |
kvstoreHandle | handle to kvstore |
MXNET_DLL int MXProfileAdjustCounter | ( | ProfileHandle | counter_handle, |
int64_t | value | ||
) |
Adjust a counter by the given amount, given its handle.
counter_handle | Handle to counter to adjust |
value | Value to adjust the counter by (64-bit signed integer) |
MXNET_DLL int MXProfileCreateCounter | ( | ProfileHandle | domain, |
const char * | counter_name, | ||
ProfileHandle * | out | ||
) |
Create profile counter.
name | Name of the counter |
domain | Domain of the counter |
out | Output handle |
MXNET_DLL int MXProfileCreateDomain | ( | const char * | domain, |
ProfileHandle * | out | ||
) |
Create profiling domain.
domain | String representing the domain name to create |
out | Return domain object |
MXNET_DLL int MXProfileCreateEvent | ( | const char * | event_name, |
ProfileHandle * | out | ||
) |
Create profile event.
name | Name of the event |
out | Output handle |
MXNET_DLL int MXProfileCreateFrame | ( | ProfileHandle | domain, |
const char * | frame_name, | ||
ProfileHandle * | out | ||
) |
Create profile frame.
name | Name of the frame |
domain | Domain of the frame |
out | Output handle |
MXNET_DLL int MXProfileCreateTask | ( | ProfileHandle | domain, |
const char * | task_name, | ||
ProfileHandle * | out | ||
) |
Create profile task.
name | Name of the task |
domain | Domain of the task |
out | Output handle |
MXNET_DLL int MXProfileDestroyHandle | ( | ProfileHandle | frame_handle | ) |
Destroy a frame.
frame_handle | Handle to frame to destroy |
MXNET_DLL int MXProfileDurationStart | ( | ProfileHandle | duration_handle | ) |
Start timing the duration of a profile duration object such as an event, task or frame.
duration_handle | handle to the duration object |
MXNET_DLL int MXProfileDurationStop | ( | ProfileHandle | duration_handle | ) |
Stop timing the duration of a profile duration object such as an event, task or frame.
duration_handle | handle to the duration object |
MXNET_DLL int MXProfilePause | ( | int | paused | ) |
Pause profiler tuning collection for worker/current process.
paused | If nonzero, profiling pauses. Otherwise, profiling resumes/continues |
MXNET_DLL int MXProfileSetCounter | ( | ProfileHandle | counter_handle, |
uint64_t | value | ||
) |
Set a counter, given its handle.
counter_handle | Handle to counter to set |
value | Value to set the counter to (64-bit unsigned integer) |
MXNET_DLL int MXProfileSetMarker | ( | ProfileHandle | domain, |
const char * | instant_marker_name, | ||
const char * | scope | ||
) |
Mark a single instant in time.
domain | Domain of the marker |
instant_marker_name | Name of the marker |
scope | Scope of marker ('global', 'process', 'thread', 'task', 'marker') |
MXNET_DLL int MXPushStreamDep | ( | NDArrayHandle | handle, |
int | stream | ||
) |
Synchronize the consumer stream with the producer stream where the NDArray lives.
handle | NDArray handle of producer. |
stream | A pointer to a stream from consumer. |
MXNET_DLL int MXQuantizeSymbol | ( | SymbolHandle | sym_handle, |
SymbolHandle * | ret_sym_handle, | ||
const int * | dev_type, | ||
const uint32_t | num_excluded_sym_names, | ||
const char ** | excluded_sym_names, | ||
const uint32_t | num_excluded_op_names, | ||
const char ** | excluded_op_names, | ||
const uint32_t | num_offline, | ||
const char ** | offline_params, | ||
const char * | quantized_dtype, | ||
const bool | calib_quantize, | ||
const char * | quantize_mode, | ||
const char * | quantize_granularity, | ||
uint32_t * | out_num_calib_names, | ||
const char *** | out_calib_names | ||
) |
Convert a symbol into a quantized symbol where FP32 operators are replaced with INT8.
sym_handle | symbol to be converted |
ret_sym_handle | quantized symbol result |
dev_type | device type |
num_excluded_sym_names | number of layers excluded from being quantized in the input symbol |
excluded_sym_names | node names to be excluded from being quantized |
num_excluded_op_names | number of operators excluded from being quantized in the input symbol |
excluded_op_names | operator names to be excluded from being quantized |
num_offline | number of parameters that are quantized offline |
offline_params | array of c strings representing the names of params quantized offline |
quantized_dtype | the quantized destination type for input data |
calib_quantize | Deprecated. quantize op will always be calibrated if could |
quantize_mode | quantize mode to be used in quantize pass |
quantize_granularity | quantize granularity, tensor-wise or channel-wise |
out_num_calib_names | return the number of nodes to be calibrated |
out_calib_names | return the node names to be calibrated |
MXNET_DLL int MXRandomSeed | ( | int | seed | ) |
Seed all global random number generators in mxnet.
seed | the random number seed. |
MXNET_DLL int MXRandomSeedContext | ( | int | seed, |
int | dev_type, | ||
int | dev_id | ||
) |
Seed the global random number generator of the given device.
seed | the random number seed. |
MXNET_DLL int MXRecordIOReaderCreate | ( | const char * | uri, |
RecordIOHandle * | out | ||
) |
Create a RecordIO reader object.
uri | path to file |
out | handle pointer to the created object |
MXNET_DLL int MXRecordIOReaderFree | ( | RecordIOHandle | handle | ) |
Delete a RecordIO reader object.
handle | handle to RecordIO object |
MXNET_DLL int MXRecordIOReaderReadRecord | ( | RecordIOHandle | handle, |
char const ** | buf, | ||
size_t * | size | ||
) |
Write a record to a RecordIO object.
handle | handle to RecordIO object |
buf | pointer to return buffer |
size | point to size of buffer |
MXNET_DLL int MXRecordIOReaderSeek | ( | RecordIOHandle | handle, |
size_t | pos | ||
) |
Set the current reader pointer position.
handle | handle to RecordIO object |
pos | target position |
MXNET_DLL int MXRecordIOReaderTell | ( | RecordIOHandle | handle, |
size_t * | pos | ||
) |
Get the current writer pointer position.
handle | handle to RecordIO object |
pos | handle to output position |
MXNET_DLL int MXRecordIOWriterCreate | ( | const char * | uri, |
RecordIOHandle * | out | ||
) |
Create a RecordIO writer object.
uri | path to file |
out | handle pointer to the created object |
MXNET_DLL int MXRecordIOWriterFree | ( | RecordIOHandle | handle | ) |
Delete a RecordIO writer object.
handle | handle to RecordIO object |
MXNET_DLL int MXRecordIOWriterTell | ( | RecordIOHandle | handle, |
size_t * | pos | ||
) |
Get the current writer pointer position.
handle | handle to RecordIO object |
pos | handle to output position |
MXNET_DLL int MXRecordIOWriterWriteRecord | ( | RecordIOHandle | handle, |
const char * | buf, | ||
size_t | size | ||
) |
Write a record to a RecordIO object.
handle | handle to RecordIO object |
buf | buffer to write |
size | size of buffer |
MXNET_DLL int MXReducePrecisionSymbol | ( | SymbolHandle | sym_handle, |
SymbolHandle * | ret_sym_handle, | ||
const int | target_dtype, | ||
const int | cast_params_offline, | ||
const char *const | offline_param_cast_attr_p, | ||
const uint32_t | num_inputs, | ||
const char **const | input_names_p, | ||
const uint32_t | num_all_args, | ||
const char **const | all_arg_names_p, | ||
const int * | all_arg_types_p, | ||
const uint32_t | num_target_dtype_ops, | ||
const char **const | target_dtype_ops_p, | ||
const uint32_t | num_fp32_ops, | ||
const char **const | fp32_ops_p, | ||
const uint32_t | num_widest_dtype_ops, | ||
const char **const | widest_dtype_ops_p | ||
) |
Convert a symbol into a mixed precision symbol with cast operators for target dtype casting.
sym_handle | symbol to be converted |
ret_sym_handle | mixed precision symbol result |
target_dtype | target_dtype for mixed precision symbol |
cast_params_offline | whether to cast parameters offline to target_dtype |
offline_param_cast_attr_p | attibute that will hold the dtype a parameter should be offline cast to (when cast_params_offline is true) |
num_inputs | number of model inputs |
input_names_p | names of model inputs |
num_all_args | number of all model arguments |
all_arg_names_p | names of all model arguments |
all_arg_types_p | dtypes of all model arguments |
num_target_dtype_ops | number of ops to be casted to target_dtype |
target_dtype_ops_p | op names to be casted to target_dtype |
num_fp32_ops | number of ops to be casted to FP32 |
fp32_ops_p | op names to be casted to fp32 |
num_widest_dtype_ops | number of ops to be casted to widest dtype |
widest_dtype_ops_p | op names to be casted to widest dtype |
num_excluded_symbols | number of symbols to be excluded from casting |
excluded_syms_p | symbol names to be excluded from casting |
MXNET_DLL int MXRtcCreate | ( | char * | name, |
uint32_t | num_input, | ||
uint32_t | num_output, | ||
char ** | input_names, | ||
char ** | output_names, | ||
NDArrayHandle * | inputs, | ||
NDArrayHandle * | outputs, | ||
char * | kernel, | ||
RtcHandle * | out | ||
) |
Create a MXRtc object.
MXNET_DLL int MXRtcCudaKernelCall | ( | CudaKernelHandle | handle, |
int | dev_id, | ||
void ** | args, | ||
uint32_t | grid_dim_x, | ||
uint32_t | grid_dim_y, | ||
uint32_t | grid_dim_z, | ||
uint32_t | block_dim_x, | ||
uint32_t | block_dim_y, | ||
uint32_t | block_dim_z, | ||
uint32_t | shared_mem | ||
) |
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 MXRtcCudaKernelFree | ( | CudaKernelHandle | handle | ) |
MXNET_DLL int MXRtcCudaModuleCreate | ( | const char * | source, |
int | num_options, | ||
const char ** | options, | ||
int | num_exports, | ||
const char ** | exports, | ||
CudaModuleHandle * | out | ||
) |
MXNET_DLL int MXRtcCudaModuleFree | ( | CudaModuleHandle | handle | ) |
MXNET_DLL int MXRtcPush | ( | RtcHandle | handle, |
uint32_t | num_input, | ||
uint32_t | num_output, | ||
NDArrayHandle * | inputs, | ||
NDArrayHandle * | outputs, | ||
uint32_t | gridDimX, | ||
uint32_t | gridDimY, | ||
uint32_t | gridDimZ, | ||
uint32_t | blockDimX, | ||
uint32_t | blockDimY, | ||
uint32_t | blockDimZ | ||
) |
Run cuda kernel.
MXNET_DLL int MXSetCalibTableToQuantizedSymbol | ( | SymbolHandle | qsym_handle, |
const uint32_t | 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.
sym_handle | symbol whose node attributes are to be set by calibration table |
num_layers | number of layers in the calibration table |
layer | names stored as keys in the calibration table |
low_quantiles | low quantiles of layers stored in the calibration table |
high_quantiles | high quantiles of layers stored in the calibration table |
ret_sym_handle | returned symbol |
MXNET_DLL int MXSetFlushDenorms | ( | bool | value, |
bool * | prev_state | ||
) |
Change floating-point calculations when dealing with denormalized values. Currently this option is only supported in CPU backend. Flushing denormalized values to zero is enabled by default.
value | state of flush-to-zero and denormals-are-zero to set. |
prev_state | state of flush-to-zero and denormals-are-zero before setting new state. |
MXNET_DLL int MXSetIsNumpyDefaultDtype | ( | bool | dtype_flag, |
bool * | prev | ||
) |
set numpy default data type
dtype_flag | false when default dtype is flaot32, true when default dtype is flaot64. |
prev | returns the previous status before this set |
MXNET_DLL int MXSetIsNumpyShape | ( | int | is_np_shape, |
int * | prev | ||
) |
set numpy compatibility switch
is_np_shape | 1 when numpy shape semantics is thread local on, 2 when numpy shape semantics is global on and 0 when off |
prev | returns the previous status before this set |
MXNET_DLL int MXSetNumOMPThreads | ( | int | thread_num | ) |
Set the number of OMP threads to use.
thread_num | Number of OMP threads desired |
MXNET_DLL int MXSetOptimizationConstraints | ( | unsigned int | constraints, |
unsigned int * | prev | ||
) |
set what optimization constraints to apply
constraints | state composed of OptConstraint flags. |
prev | returns the previous status before this set. |
MXNET_DLL int MXSetOptimizeLayout | ( | bool | val | ) |
Turns on or off Layout Optimization.
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.
num_params | Number of parameters |
keys | array of parameter keys |
vals | array of parameter values |
kvstoreHandle | handle to kvstore |
MXNET_DLL int MXSetProcessProfilerState | ( | int | state, |
int | profile_process, | ||
KVStoreHandle | kvStoreHandle | ||
) |
Set up state of profiler for either worker or server process.
state | indicate the working state of profiler, profiler not running when state == 0, profiler running when state == 1 |
profile_process | an int, when 0 command is for worker/current process, when 1 command is for server process |
kvstoreHandle | handle to kvstore, needed for server process profiling |
MXNET_DLL int MXSetProfilerConfig | ( | int | num_params, |
const char *const * | keys, | ||
const char *const * | vals | ||
) |
Set up configuration of profiler for worker/current process.
num_params | Number of parameters |
keys | array of parameter keys |
vals | array of parameter values |
MXNET_DLL int MXSetProfilerScope | ( | const char * | scope | ) |
Set the scope of profiler for current process.
scope | indicate the working scope of profiler |
MXNET_DLL int MXSetProfilerState | ( | int | state | ) |
Set up state of profiler for current process.
state | indicate the working state of profiler, profiler not running when state == 0, profiler running when state == 1 |
MXNET_DLL int MXShallowCopyNDArray | ( | NDArrayHandle | src, |
NDArrayHandle * | out | ||
) |
Create an NDArray from source sharing the same data chunk.
src | source NDArray |
out | new NDArray sharing the same data chunck with src |
MXNET_DLL int MXShallowCopySymbol | ( | SymbolHandle | src, |
SymbolHandle * | out | ||
) |
Create an Symbol from source sharing the same graph structure.
src | source Symbol |
out | new Symbol sharing the same graph structure with src |
MXNET_DLL int MXStorageEmptyCache | ( | int | dev_type, |
int | dev_id | ||
) |
Release all unreferenced memory from the devices storage managers memory pool.
dev_type | device type, specify device we want to take |
dev_id | the device id of the specific device |
MXNET_DLL int MXSymbolCompose | ( | SymbolHandle | sym, |
const char * | name, | ||
uint32_t | num_args, | ||
const char ** | keys, | ||
SymbolHandle * | args | ||
) |
Compose the symbol on other symbols.
This function will change the sym hanlde. To achieve function apply behavior, copy the symbol first before apply.
sym | the symbol to apply |
name | the name of symbol |
num_args | number of arguments |
keys | the key of keyword args (optional) |
args | arguments to sym |
MXNET_DLL int MXSymbolCopy | ( | SymbolHandle | symbol, |
SymbolHandle * | out | ||
) |
Copy the symbol to another handle.
symbol | the source symbol |
out | used to hold the result of copy |
MXNET_DLL int MXSymbolCreateAtomicSymbol | ( | AtomicSymbolCreator | creator, |
uint32_t | num_param, | ||
const char ** | keys, | ||
const char ** | vals, | ||
SymbolHandle * | out | ||
) |
Create an AtomicSymbol.
A Symbol is said to be atomic if it is not composed of other Symbols. Atomic Symbols can be composed.
creator | the AtomicSymbolCreator |
num_param | the number of parameters |
keys | the keys to the params |
vals | the vals of the params |
out | pointer to the created symbol handle |
MXNET_DLL int MXSymbolCreateFromFile | ( | const char * | fname, |
SymbolHandle * | out | ||
) |
Load a symbol from a json file.
fname | the file name. |
out | the output symbol. |
MXNET_DLL int MXSymbolCreateFromJSON | ( | const char * | json, |
SymbolHandle * | out | ||
) |
Load a symbol from a json string.
json | the json string. |
out | the output symbol. |
MXNET_DLL int MXSymbolCreateGroup | ( | uint32_t | num_symbols, |
SymbolHandle * | symbols, | ||
SymbolHandle * | out | ||
) |
Create a Symbol by grouping list of symbols together.
num_symbols | number of symbols to be grouped |
symbols | array of symbol handles |
out | pointer to the created symbol handle |
MXNET_DLL int MXSymbolCreateVariable | ( | const char * | name, |
SymbolHandle * | out | ||
) |
Create a Variable Symbol.
name | name of the variable |
out | pointer to the created symbol handle |
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. A variable node will be created for each edge that connects to nodes outside the subgraph. The outside nodes that connect to the subgraph will be returned.
sym | The graph. |
inputs | The nodes that connect to the subgraph. |
input_size | The number of such nodes. |
MXNET_DLL int MXSymbolFree | ( | SymbolHandle | symbol | ) |
Free the symbol handle.
symbol | the symbol |
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 | DEFAULTNULL | ||
) |
Get the detailed information about atomic symbol.
creator | the AtomicSymbolCreator. |
name | The returned name of the creator. |
description | The returned description of the symbol. |
num_args | Number of arguments. |
arg_names | Name of the arguments. |
arg_type_infos | Type informations about the arguments. |
arg_descriptions | Description information about the arguments. |
key_var_num_args | The keyword argument for specifying variable number of arguments. When this parameter has non-zero length, the function allows variable number of positional arguments, and will need the caller to pass it in in MXSymbolCreateAtomicSymbol, With key = key_var_num_args, and value = number of positional arguments. |
return_type | Return type of the function, can be Symbol or Symbol[] |
MXNET_DLL int MXSymbolGetAtomicSymbolName | ( | AtomicSymbolCreator | creator, |
const char ** | name | ||
) |
Get the name of an atomic symbol.
creator | the AtomicSymbolCreator. |
name | The returned name of the creator. |
MXNET_DLL int MXSymbolGetAttr | ( | SymbolHandle | symbol, |
const char * | key, | ||
const char ** | out, | ||
int * | success | ||
) |
Get string attribute from symbol.
symbol | the source symbol |
key | The key of the symbol. |
out | The result attribute, can be NULL if the attribute do not exist. |
success | Whether the result is contained in out. |
MXNET_DLL int MXSymbolGetChildren | ( | SymbolHandle | symbol, |
SymbolHandle * | out | ||
) |
Get a symbol that contains only direct children.
symbol | The symbol |
out | The output symbol whose outputs are the direct children. |
MXNET_DLL int MXSymbolGetInputs | ( | SymbolHandle | symbol, |
SymbolHandle * | out | ||
) |
Get a symbol that contains all the inputs.
symbol | The symbol |
out | The output symbol whose outputs are all the internals. |
MXNET_DLL int MXSymbolGetInputSymbols | ( | SymbolHandle | sym, |
SymbolHandle ** | inputs, | ||
int * | input_size | ||
) |
Get the input symbols of the graph.
sym | The graph. |
inputs | The input symbols of the graph. |
input_size | the number of input symbols returned. |
MXNET_DLL int MXSymbolGetInternals | ( | SymbolHandle | symbol, |
SymbolHandle * | out | ||
) |
Get a symbol that contains all the internals.
symbol | The symbol |
out | The output symbol whose outputs are all the internals. |
MXNET_DLL int MXSymbolGetName | ( | SymbolHandle | symbol, |
const char ** | out, | ||
int * | success | ||
) |
Get string name from symbol.
symbol | the source symbol |
out | The result name. |
success | Whether the result is contained in out. |
MXNET_DLL int MXSymbolGetNumOutputs | ( | SymbolHandle | symbol, |
uint32_t * | output_count | ||
) |
Get number of outputs of the symbol.
symbol | The symbol |
out_size | number of outputs |
MXNET_DLL int MXSymbolGetOutput | ( | SymbolHandle | symbol, |
uint32_t | index, | ||
SymbolHandle * | out | ||
) |
Get index-th outputs of the symbol.
symbol | The symbol |
index | the Index of the output. |
out | The output symbol whose outputs are the index-th symbol. |
MXNET_DLL int MXSymbolGrad | ( | SymbolHandle | sym, |
uint32_t | num_wrt, | ||
const char ** | wrt, | ||
SymbolHandle * | out | ||
) |
Get the gradient graph of the symbol.
sym | the symbol to get gradient |
num_wrt | number of arguments to get gradient |
wrt | the name of the arguments to get gradient |
out | the returned symbol that has gradient |
MXNET_DLL int MXSymbolInferShape | ( | SymbolHandle | sym, |
uint32_t | num_args, | ||
const char ** | keys, | ||
const uint32_t * | arg_ind_ptr, | ||
const int * | arg_shape_data, | ||
uint32_t * | in_shape_size, | ||
const int ** | in_shape_ndim, | ||
const int *** | in_shape_data, | ||
uint32_t * | out_shape_size, | ||
const int ** | out_shape_ndim, | ||
const int *** | out_shape_data, | ||
uint32_t * | aux_shape_size, | ||
const int ** | aux_shape_ndim, | ||
const int *** | aux_shape_data, | ||
int * | complete | ||
) |
infer shape of unknown input shapes given the known one. The shapes are packed into a CSR matrix represented by arg_ind_ptr and arg_shape_data The call will be treated as a kwargs call if key != NULL or num_args==0, otherwise it is positional. This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default)
sym | symbol handle |
num_args | number of input arguments. |
keys | the key of keyword args (optional) |
arg_ind_ptr | the head pointer of the rows in CSR |
arg_shape_data | the content of the CSR |
in_shape_size | sizeof the returning array of in_shapes |
in_shape_ndim | returning array of shape dimensions of eachs input shape. |
in_shape_data | returning array of pointers to head of the input shape. |
out_shape_size | sizeof the returning array of out_shapes |
out_shape_ndim | returning array of shape dimensions of each output shape. |
out_shape_data | returning array of pointers to head of the output shape. |
aux_shape_size | sizeof the returning array of aux_shapes |
aux_shape_ndim | returning array of shape dimensions of each auxiliary shape. |
aux_shape_data | returning array of pointers to head of the auxiliary shape. |
complete | whether infer shape completes or more information is needed. |
MXNET_DLL int MXSymbolInferShape64 | ( | SymbolHandle | sym, |
uint32_t | num_args, | ||
const char ** | keys, | ||
const int64_t * | arg_ind_ptr, | ||
const int64_t * | arg_shape_data, | ||
size_t * | in_shape_size, | ||
const int ** | in_shape_ndim, | ||
const int64_t *** | in_shape_data, | ||
size_t * | out_shape_size, | ||
const int ** | out_shape_ndim, | ||
const int64_t *** | out_shape_data, | ||
size_t * | aux_shape_size, | ||
const int ** | aux_shape_ndim, | ||
const int64_t *** | aux_shape_data, | ||
int * | complete | ||
) |
infer shape of unknown input shapes given the known one. The shapes are packed into a CSR matrix represented by arg_ind_ptr and arg_shape_data
The call will be treated as a kwargs call if key != NULL or num_args==0, otherwise it is positional. This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support
sym | symbol handle |
num_args | number of input arguments. |
keys | the key of keyword args (optional) |
arg_ind_ptr | the head pointer of the rows in CSR |
arg_shape_data | the content of the CSR |
in_shape_size | sizeof the returning array of in_shapes |
in_shape_ndim | returning array of shape dimensions of each input shape. |
in_shape_data | returning array of pointers to head of the input shape. |
out_shape_size | sizeof the returning array of out_shapes |
out_shape_ndim | returning array of shape dimensions of each output shape. |
out_shape_data | returning array of pointers to head of the output shape. |
aux_shape_size | sizeof the returning array of aux_shapes |
aux_shape_ndim | returning array of shape dimensions of each auxiliary shape. |
aux_shape_data | returning array of pointers to head of the auxiliary shape. |
complete | whether infer shape completes or more information is needed. |
MXNET_DLL int MXSymbolInferShapePartial | ( | SymbolHandle | sym, |
uint32_t | num_args, | ||
const char ** | keys, | ||
const uint32_t * | arg_ind_ptr, | ||
const int * | arg_shape_data, | ||
uint32_t * | in_shape_size, | ||
const int ** | in_shape_ndim, | ||
const int *** | in_shape_data, | ||
uint32_t * | out_shape_size, | ||
const int ** | out_shape_ndim, | ||
const int *** | out_shape_data, | ||
uint32_t * | aux_shape_size, | ||
const int ** | aux_shape_ndim, | ||
const int *** | aux_shape_data, | ||
int * | complete | ||
) |
partially infer shape of unknown input shapes given the known one.
Return partially inferred results if not all shapes could be inferred. The shapes are packed into a CSR matrix represented by arg_ind_ptr and arg_shape_data The call will be treated as a kwargs call if key != NULL or num_args==0, otherwise it is positional. This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=0 (by default)
sym | symbol handle |
num_args | number of input arguments. |
keys | the key of keyword args (optional) |
arg_ind_ptr | the head pointer of the rows in CSR |
arg_shape_data | the content of the CSR |
in_shape_size | sizeof the returning array of in_shapes |
in_shape_ndim | returning array of shape dimensions of each input shape. |
in_shape_data | returning array of pointers to head of the input shape. |
out_shape_size | sizeof the returning array of out_shapes |
out_shape_ndim | returning array of shape dimensions of each output shape. |
out_shape_data | returning array of pointers to head of the output shape. |
aux_shape_size | sizeof the returning array of aux_shapes |
aux_shape_ndim | returning array of shape dimensions of each auxiliary shape. |
aux_shape_data | returning array of pointers to head of the auxiliary shape. |
complete | whether infer shape completes or more information is needed. |
MXNET_DLL int MXSymbolInferShapePartial64 | ( | SymbolHandle | sym, |
uint32_t | num_args, | ||
const char ** | keys, | ||
const int64_t * | arg_ind_ptr, | ||
const int64_t * | arg_shape_data, | ||
size_t * | in_shape_size, | ||
const int ** | in_shape_ndim, | ||
const int64_t *** | in_shape_data, | ||
size_t * | out_shape_size, | ||
const int ** | out_shape_ndim, | ||
const int64_t *** | out_shape_data, | ||
size_t * | aux_shape_size, | ||
const int ** | aux_shape_ndim, | ||
const int64_t *** | aux_shape_data, | ||
int * | complete | ||
) |
partially infer shape of unknown input shapes given the known one.
Return partially inferred results if not all shapes could be inferred. The shapes are packed into a CSR matrix represented by arg_ind_ptr and arg_shape_data The call will be treated as a kwargs call if key != NULL or num_args==0, otherwise it is positional. This api is available when MXNet is built with flag USE_INT64_TENSOR_SIZE=1 (not default) i.e. Large Tensor Support
sym | symbol handle |
num_args | number of input arguments. |
keys | the key of keyword args (optional) |
arg_ind_ptr | the head pointer of the rows in CSR |
arg_shape_data | the content of the CSR |
in_shape_size | sizeof the returning array of in_shapes |
in_shape_ndim | returning array of shape dimensions of each input shape. |
in_shape_data | returning array of pointers to head of the input shape. |
out_shape_size | sizeof the returning array of out_shapes |
out_shape_ndim | returning array of shape dimensions of each output shape. |
out_shape_data | returning array of pointers to head of the output shape. |
aux_shape_size | sizeof the returning array of aux_shapes |
aux_shape_ndim | returning array of shape dimensions of each auxiliary shape. |
aux_shape_data | returning array of pointers to head of the auxiliary shape. |
complete | whether infer shape completes or more information is needed. |
MXNET_DLL int MXSymbolInferType | ( | SymbolHandle | sym, |
uint32_t | num_args, | ||
const char ** | keys, | ||
const int * | arg_type_data, | ||
uint32_t * | in_type_size, | ||
const int ** | in_type_data, | ||
uint32_t * | out_type_size, | ||
const int ** | out_type_data, | ||
uint32_t * | 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 represented by arg_ind_ptr and arg_type_data The call will be treated as a kwargs call if key != NULL or num_args==0, otherwise it is positional.
sym | symbol handle |
num_args | numbe of input arguments. |
keys | the key of keyword args (optional) |
arg_type_data | the content of the CSR |
in_type_size | sizeof the returning array of in_types |
in_type_data | returning array of pointers to head of the input type. |
out_type_size | sizeof the returning array of out_types |
out_type_data | returning array of pointers to head of the output type. |
aux_type_size | sizeof the returning array of aux_types |
aux_type_data | returning array of pointers to head of the auxiliary type. |
complete | whether infer type completes or more information is needed. |
MXNET_DLL int MXSymbolInferTypePartial | ( | SymbolHandle | sym, |
uint32_t | num_args, | ||
const char ** | keys, | ||
const int * | arg_type_data, | ||
uint32_t * | in_type_size, | ||
const int ** | in_type_data, | ||
uint32_t * | out_type_size, | ||
const int ** | out_type_data, | ||
uint32_t * | aux_type_size, | ||
const int ** | aux_type_data, | ||
int * | complete | ||
) |
partially infer type of unknown input types given the known one.
Return partially inferred results if not all types could be inferred. The types are packed into a CSR matrix represented by arg_ind_ptr and arg_type_data The call will be treated as a kwargs call if key != NULL or num_args==0, otherwise it is positional.
sym | symbol handle |
num_args | numbe of input arguments. |
keys | the key of keyword args (optional) |
arg_type_data | the content of the CSR |
in_type_size | sizeof the returning array of in_types |
in_type_data | returning array of pointers to head of the input type. |
out_type_size | sizeof the returning array of out_types |
out_type_data | returning array of pointers to head of the output type. |
aux_type_size | sizeof the returning array of aux_types |
aux_type_data | returning array of pointers to head of the auxiliary type. |
complete | whether infer type completes or more information is needed. |
MXNET_DLL int MXSymbolListArguments | ( | SymbolHandle | symbol, |
uint32_t * | out_size, | ||
const char *** | out_str_array | ||
) |
List arguments in the symbol.
symbol | the symbol |
out_size | output size |
out_str_array | pointer to hold the output string array |
MXNET_DLL int MXSymbolListAtomicSymbolCreators | ( | uint32_t * | out_size, |
AtomicSymbolCreator ** | out_array | ||
) |
list all the available AtomicSymbolEntry
out_size | the size of returned array |
out_array | the output AtomicSymbolCreator array |
MXNET_DLL int MXSymbolListAttr | ( | SymbolHandle | symbol, |
uint32_t * | out_size, | ||
const char *** | out | ||
) |
Get all attributes from symbol, including all descendents.
symbol | the source symbol |
out_size | The number of output attributes |
out | 2*out_size strings representing key value pairs. |
MXNET_DLL int MXSymbolListAttrShallow | ( | SymbolHandle | symbol, |
uint32_t * | out_size, | ||
const char *** | out | ||
) |
Get all attributes from symbol, excluding descendents.
symbol | the source symbol |
out_size | The number of output attributes |
out | 2*out_size strings representing key value pairs. |
MXNET_DLL int MXSymbolListAuxiliaryStates | ( | SymbolHandle | symbol, |
uint32_t * | out_size, | ||
const char *** | out_str_array | ||
) |
List auxiliary states in the symbol.
symbol | the symbol |
out_size | output size |
out_str_array | pointer to hold the output string array |
MXNET_DLL int MXSymbolListOutputs | ( | SymbolHandle | symbol, |
uint32_t * | out_size, | ||
const char *** | out_str_array | ||
) |
List returns in the symbol.
symbol | the symbol |
out_size | output size |
out_str_array | pointer to hold the output string array |
MXNET_DLL int MXSymbolPrint | ( | SymbolHandle | symbol, |
const char ** | out_str | ||
) |
Print the content of symbol, used for debug.
symbol | the symbol |
out_str | pointer to hold the output string of the printing. |
MXNET_DLL int MXSymbolRemoveAmpCast | ( | SymbolHandle | sym_handle, |
SymbolHandle * | ret_sym_handle | ||
) |
Remove the operators amp_cast and amp_multicast.
sym_handle | the input symbol. |
ret_sym_handle | the output symbol. |
MXNET_DLL int MXSymbolSaveToFile | ( | SymbolHandle | symbol, |
const char * | fname | ||
) |
Save a symbol into a json file.
symbol | the input symbol. |
fname | the file name. |
MXNET_DLL int MXSymbolSaveToJSON | ( | SymbolHandle | symbol, |
const char ** | out_json | ||
) |
Save a symbol into a json string.
symbol | the input symbol. |
out_json | output json string. |
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(mutable/immutable) of symbolic graph.
Safe recommendaton: use immutable graph
Mutable graph (be careful about the semantics):
symbol | the source symbol |
key | The key of the symbol. |
value | The value to be saved. |
const typedef void* ContextHandle |
handle to Context
const typedef void* EngineFnPropertyHandle |
handle to Engine FnProperty
const typedef void* FunctionHandle |
handle to a mxnet narray function that changes NDArray