AI-MXNetCAPI
view release on metacpan or search on metacpan
mx_uint *out,
mx_uint *out,
mx_uint *out,
int *out);
/*!
* \brief invoke a function, the array size of passed in arguments
* must match the values in the
* \param fun the function
* \param use_vars the normal arguments passed to function
* \param scalar_args the scalar qarguments
* \param mutate_vars the mutate arguments
* \return 0 when success, -1 when failure happens
* \sa MXFuncDescribeArgs
*/
int MXFuncInvoke(FunctionHandle fun,
NDArrayHandle *in,
mx_float *in,
NDArrayHandle *in);
/*!
* \brief invoke a function, the array size of passed in arguments
* must match the values in the
* \param fun the function
* \param use_vars the normal arguments passed to function
* \param scalar_args the scalar qarguments
* \param mutate_vars the mutate arguments
* \param num_params number of keyword parameters
* \param param_keys keys for keyword parameters
* \param param_vals values for keyword parameters
* \return 0 when success, -1 when failure happens
* \sa MXFuncDescribeArgs
*/
int MXFuncInvokeEx(FunctionHandle fun,
NDArrayHandle *in,
mx_float *in,
NDArrayHandle *in,
int num_params,
char **keys,
char **vals);
/*!
* \brief invoke a nnvm op and imperative function
* \param creator the op
* \param num_inputs number of input NDArrays
* \param inputs input NDArrays
* \param num_outputs number of output NDArrays
* \param outputs output NDArrays
* \param num_params number of keyword parameters
* \param param_keys keys for keyword parameters
* \param param_vals values for keyword parameters
* \return 0 when success, -1 when failure happens
*/
int MXImperativeInvoke(AtomicSymbolCreator in,
int num_inputs,
NDArrayHandle *in,
int *out_size,
NDArrayHandle **out_array,
int num_params,
const char **keys,
const char **vals);
/*!
* \brief set whether to record operator for autograd
* \param is_train 1 when training, 0 when testing
* \param prev returns the previous status before this set.
* \return 0 when success, -1 when failure happens
*/
int MXAutogradSetIsTraining(int is_training, int* out);
/*!
* \brief mark NDArrays as variables to compute gradient for autograd
* \param num_var number of variable NDArrays
* \param var_handles variable NDArrays
* \return 0 when success, -1 when failure happens
*/
int MXAutogradMarkVariables(mx_uint num_var,
NDArrayHandle *in,
mx_uint *in,
NDArrayHandle *in);
/*!
* \brief compute the gradient of outputs w.r.t variables
* \param num_output number of output NDArray
* \param output_handles output NDArrays
* \return 0 when success, -1 when failure happens
*/
int MXAutogradComputeGradient(mx_uint num_output,
NDArrayHandle* in);
/*!
* \brief compute the gradient of outputs w.r.t variabels
* \param num_output number of output NDArray
* \param output_handles output NDArrays
* \param ograd_handles head gradient for NDArrays
* \param retain_graph whether to keep the graph after backward
* \return 0 when success, -1 when failure happens
*/
int MXAutogradBackward(mx_uint num_output,
NDArrayHandle* in,
NDArrayHandle* in,
int retain_graph);
/*!
* \brief create cached operator
*/
int MXCreateCachedOp(SymbolHandle handle,
CachedOpHandle *out);
/*!
* \brief free cached operator
*/
int MXFreeCachedOp(CachedOpHandle handle);
/*!
* \brief invoke cached operator
*/
int MXInvokeCachedOp(CachedOpHandle handle,
int num_inputs,
NDArrayHandle *in,
int *out_size,
NDArrayHandle **out_array);
//--------------------------------------------
// Part 3: symbolic configuration generation
//--------------------------------------------
/*!
* \brief list all the available operator names, include entries.
* \param out_size the size of returned array
* \param out_array the output operator name array.
* \return 0 when success, -1 when failure happens
( run in 0.490 second using v1.01-cache-2.11-cpan-7fcb06a456a )