mxnet
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
c_predict_api.h
Go to the documentation of this file.
1 
7 #ifndef MXNET_C_PREDICT_API_H_
8 #define MXNET_C_PREDICT_API_H_
9 
10 #ifdef __cplusplus
11 #define MXNET_EXTERN_C extern "C"
12 #else
13 #define MXNET_EXTERN_C
14 #endif
15 
16 #ifdef _WIN32
17 #ifdef MXNET_EXPORTS
18 #define MXNET_DLL MXNET_EXTERN_C __declspec(dllexport)
19 #else
20 #define MXNET_DLL MXNET_EXTERN_C __declspec(dllimport)
21 #endif
22 #else
23 #define MXNET_DLL MXNET_EXTERN_C
24 #endif
25 
27 typedef unsigned int mx_uint;
29 typedef float mx_float;
31 typedef void *PredictorHandle;
33 typedef void *NDListHandle;
34 
39 MXNET_DLL const char* MXGetLastError();
40 
60 MXNET_DLL int MXPredCreate(const char* symbol_json_str,
61  const void* param_bytes,
62  int param_size,
63  int dev_type, int dev_id,
64  mx_uint num_input_nodes,
65  const char** input_keys,
66  const mx_uint* input_shape_indptr,
67  const mx_uint* input_shape_data,
68  PredictorHandle* out);
69 
93 MXNET_DLL int MXPredCreatePartialOut(const char* symbol_json_str,
94  const void* param_bytes,
95  int param_size,
96  int dev_type, int dev_id,
97  mx_uint num_input_nodes,
98  const char** input_keys,
99  const mx_uint* input_shape_indptr,
100  const mx_uint* input_shape_data,
101  mx_uint num_output_nodes,
102  const char** output_keys,
103  PredictorHandle* out);
114  mx_uint index,
115  mx_uint** shape_data,
116  mx_uint* shape_ndim);
127  const char* key,
128  const mx_float* data,
129  mx_uint size);
152 MXNET_DLL int MXPredPartialForward(PredictorHandle handle, int step, int* step_left);
162  mx_uint index,
163  mx_float* data,
164  mx_uint size);
180 MXNET_DLL int MXNDListCreate(const char* nd_file_bytes,
181  int nd_file_size,
182  NDListHandle *out,
183  mx_uint* out_length);
195  mx_uint index,
196  const char** out_key,
197  const mx_float** out_data,
198  const mx_uint** out_shape,
199  mx_uint* out_ndim);
206 
207 #endif // MXNET_C_PREDICT_API_H_
MXNET_DLL int MXPredForward(PredictorHandle handle)
Run a forward pass to get the output.
MXNET_DLL int MXNDListCreate(const char *nd_file_bytes, int nd_file_size, NDListHandle *out, mx_uint *out_length)
Create a NDArray List by loading from ndarray file. This can be used to load mean image file...
MXNET_DLL int MXPredSetInput(PredictorHandle handle, const char *key, const mx_float *data, mx_uint size)
Set the input data of predictor.
MXNET_DLL int MXPredCreatePartialOut(const char *symbol_json_str, const void *param_bytes, int param_size, int dev_type, int dev_id, mx_uint num_input_nodes, const char **input_keys, const mx_uint *input_shape_indptr, const mx_uint *input_shape_data, mx_uint num_output_nodes, const char **output_keys, PredictorHandle *out)
create a predictor wich customized outputs
MXNET_DLL int MXNDListFree(NDListHandle handle)
Free a predictor handle.
void * PredictorHandle
handle to Predictor
Definition: c_predict_api.h:31
MXNET_DLL int MXPredFree(PredictorHandle handle)
Free a predictor handle.
unsigned int mx_uint
manually define unsigned int
Definition: c_predict_api.h:27
float mx_float
manually define float
Definition: c_predict_api.h:29
unsigned int mx_uint
manually define unsigned int
Definition: c_api.h:27
void * NDListHandle
handle to NDArray list
Definition: c_predict_api.h:33
MXNET_DLL const char * MXGetLastError()
Get the last error happeneed.
MXNET_DLL int MXPredGetOutputShape(PredictorHandle handle, mx_uint index, mx_uint **shape_data, mx_uint *shape_ndim)
Get the shape of output node. The returned shape_data and shape_ndim is only valid before next call t...
float mx_float
manually define float
Definition: c_api.h:29
MXNET_DLL int MXPredCreate(const char *symbol_json_str, const void *param_bytes, int param_size, int dev_type, int dev_id, mx_uint num_input_nodes, const char **input_keys, const mx_uint *input_shape_indptr, const mx_uint *input_shape_data, PredictorHandle *out)
create a predictor
#define MXNET_DLL
Definition: c_predict_api.h:23
MXNET_DLL int MXPredPartialForward(PredictorHandle handle, int step, int *step_left)
Run a interactive forward pass to get the output. This is helpful for displaying progress of predicti...
MXNET_DLL int MXPredGetOutput(PredictorHandle handle, mx_uint index, mx_float *data, mx_uint size)
Get the output value of prediction.
MXNET_DLL int MXNDListGet(NDListHandle handle, mx_uint index, const char **out_key, const mx_float **out_data, const mx_uint **out_shape, mx_uint *out_ndim)
Get an element from list.