#include <dlpack/dlpack.h>
#include <mxnet/c_api.h>
#include <stdint.h>
#include <stddef.h>
Go to the source code of this file.
|
union | MXNetValue |
| Union type of values being passed through API and function calls. More...
|
|
struct | MXNetByteArray |
| Byte array type used to pass in byte array When kBytes is used as data type. More...
|
|
|
enum | MXNetTypeCode {
kHandle = 3U,
kNull = 4U,
kMXNetType = 5U,
kMXNetContext = 6U,
kObjectHandle = 7U,
kStr = 8U,
kBytes = 9U,
kPyArg = 10U,
kNDArrayHandle = 11U,
kExtBegin = 15U,
kNNVMFirst = 16U,
kNNVMLast = 20U,
kExtReserveEnd = 64U,
kExtEnd = 128U,
kCustomBegin = 129U
} |
| The type code in MXNetType. More...
|
|
◆ MXNetFunctionHandle
Handle to packed function handle.
◆ MXNetObjectHandle
◆ MXNetTypeCode
The type code in MXNetType.
- Note
- MXNetType is used in two places.
Enumerator |
---|
kHandle | |
kNull | |
kMXNetType | |
kMXNetContext | |
kObjectHandle | |
kStr | |
kBytes | |
kPyArg | |
kNDArrayHandle | |
kExtBegin | |
kNNVMFirst | |
kNNVMLast | |
kExtReserveEnd | |
kExtEnd | |
kCustomBegin | |
◆ MXNetFuncCall()
Call a Packed MXNet Function.
- Parameters
-
func | node handle of the function. |
arg_values | The arguments |
type_codes | The type codes of the arguments |
num_args | Number of arguments. |
ret_val | The return value. |
ret_type_code | the type code of return value. |
- Returns
- 0 when success, -1 when failure happens
- Note
- MXNet calls always exchanges with type bits=64, lanes=1
-
API calls always exchanges with type bits=64, lanes=1 If API call returns container handles (e.g. FunctionHandle) these handles should be managed by the front-end. The front-end need to call free function (e.g. MXNetFuncFree) to free these handles.
◆ MXNetFuncFree()
Free the function when it is no longer needed.
- Parameters
-
- Returns
- 0 when success, -1 when failure happens
◆ MXNetFuncGetGlobal()
Get a global function.
- Parameters
-
name | The name of the function. |
out | the result function pointer, NULL if it does not exist. |
- Note
- The function handle of global function is managed by MXNet runtime, So MXNetFuncFree is should not be called when it get deleted.
◆ MXNetFuncListGlobalNames()
MXNET_DLL int MXNetFuncListGlobalNames |
( |
int * |
out_size, |
|
|
const char *** |
out_array |
|
) |
| |
List all the globally registered function name.
- Parameters
-
out_size | The number of functions |
out_array | The array of function names. |
- Returns
- 0 when success, -1 when failure happens
◆ MXNetObjectFree()
Free the object.
- Parameters
-
- Note
- Internally we decrease the reference counter of the object. The object will be freed when every reference to the object are removed.
- Returns
- 0 when success, -1 when failure happens
◆ MXNetObjectGetTypeIndex()
Get the type_index from an object.
- Parameters
-
obj | The object handle. |
out_tindex | the output type index. |
- Returns
- 0 when success, -1 when failure happens
◆ MXNetObjectTypeKey2Index()
MXNET_DLL int MXNetObjectTypeKey2Index |
( |
const char * |
type_key, |
|
|
unsigned * |
out_tindex |
|
) |
| |
Convert type key to type index.
- Parameters
-
type_key | The key of the type. |
out_tindex | the corresponding type index. |
- Returns
- 0 when success, -1 when failure happens