Commit 8f81dd23 authored by Carlos Ungil's avatar Carlos Ungil

Predict API

parents
(in-package :cl-user)
(ql:quickload :mxnet-predict)
(ql:quickload :opticl)
;;; cd ~
;;; wget http://data.dmlc.ml/mxnet/models/imagenet/inception-bn.tar.gz
;;; tar xvzf inception-bn.tar.gz
;;; ls ~/model
(defvar *data-dir* "~/model")
(defun file-as-string (path)
(with-open-file (s path)
(let* ((len (file-length s))
(data (make-string len)))
(values data (read-sequence data s)))))
(defun file-as-bytes (path)
(with-open-file (s path :element-type 'unsigned-byte)
(let* ((len (file-length s))
(data (make-array len :element-type 'unsigned-byte)))
(values data (read-sequence data s)))))
(defvar *labels*
(with-open-file (in (format nil "~A/synset.txt" *data-dir*))
(loop for line = (read-line in nil nil) while line collect line)))
(defvar *json*
(file-as-string (format nil "~A/Inception_BN-symbol.json" *data-dir*)))
(defvar *params*
(file-as-bytes (format nil "~A/Inception_BN-0039.params" *data-dir*)))
(defvar *predictor*
(mxpred:predictor *json* *params* '(("data" 1 3 224 224)) :dev-type :cpu))
(defun identify-image (png-file &optional (top 5))
(let* ((image (opticl:coerce-image
(opticl:resize-image (opticl:read-png-file png-file) 224 224)
'opticl:rgb-image))
(data (make-array (* 1 3 224 224) :element-type 'single-float
:initial-contents (loop for c from 0 below 3
append (loop for i from c by 3 below (array-total-size image)
collect (- (row-major-aref image i) 128.0))))))
(mxpred:forward *predictor* `(("data" ,data)))
(subseq (sort (loop for prob in (mxpred:get-output *predictor*)
for label in *labels*
collect (cons prob label))
#'> :key #'car)
0 top)))
;;; wget http://pngimg.com/upload/cup_PNG2000.png
;; (identify-image "~/cup_PNG2000.png")
;; ((0.44806847 "n07930864 cup")
;; (0.2880092 "n02823750 beer glass")
;; (0.09610717 "n07920052 espresso")
;; (0.036979508 "n02948072 candle, taper, wax light")
;; (0.023760669 "n07584110 consomme"))
;;; wget http://pngimg.com/upload/small/car_wheel_PNG1079.png
;; (identify-image "~/car_wheel_PNG1079.png")
;; ((0.99627846 "n02974003 car wheel")
;; (0.0010841467 "n03208938 disk brake, disc brake")
;; (4.2866074e-4 "n04548280 wall clock")
;; (3.3683694e-4 "n03777568 Model T")
;; (1.7127325e-4 "n03065424 coil, spiral, volute, whorl, helix"))
;;; wget http://orig04.deviantart.net/758b/f/2014/068/6/c/elephant_5_png_by_clipartcotttage-d79kjov.png
;; (identify-image "~/elephant_5_png_by_clipartcotttage-d79kjov.png")
;; ((0.31204274 "n02504013 Indian elephant, Elephas maximus")
;; (0.29726356 "n02504458 African elephant, Loxodonta africana")
;; (0.11172767 "n01704323 triceratops")
;; (0.1089943 "n01871265 tusker")
;; (0.041385192 "n03146219 cuirass"))
/*!
* Copyright (c) 2015 by Contributors
* \file c_predict_api.h
* \brief C predict API of mxnet, contains a minimum API to run prediction.
* This file is self-contained, and do not dependent on any other files.
*/
#ifndef MXNET_C_PREDICT_API_H_
#define MXNET_C_PREDICT_API_H_
/*! \brief Inhibit C++ name-mangling for MXNet functions. */
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#ifdef _WIN32
#ifdef MXNET_EXPORTS
#define MXNET_DLL __declspec(dllexport)
#else
#define MXNET_DLL __declspec(dllimport)
#endif
#else
#define MXNET_DLL
#endif
/*! \brief manually define unsigned int */
typedef unsigned int mx_uint;
/*! \brief manually define float */
typedef float mx_float;
/*! \brief handle to Predictor */
typedef void *PredictorHandle;
/*! \brief handle to NDArray list */
typedef void *NDListHandle;
/*!
* \brief Get the last error happeneed.
* \return The last error happened at the predictor.
*/
MXNET_DLL const char* MXGetLastError();
/*!
* \brief create a predictor
* \param symbol_json_str The JSON string of the symbol.
* \param param_bytes The in-memory raw bytes of parameter ndarray file.
* \param param_size The size of parameter ndarray file.
* \param dev_type The device type, 1: cpu, 2:gpu
* \param dev_id The device id of the predictor.
* \param num_input_nodes Number of input nodes to the net,
* For feedforward net, this is 1.
* \param input_keys The name of input argument.
* For feedforward net, this is {"data"}
* \param input_shape_indptr Index pointer of shapes of each input node.
* The length of this array = num_input_nodes + 1.
* For feedforward net that takes 4 dimensional input, this is {0, 4}.
* \param input_shape_data A flatted data of shapes of each input node.
* For feedforward net that takes 4 dimensional input, this is the shape data.
* \param out The created predictor handle.
* \return 0 when success, -1 when failure.
*/
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);
/*!
* \brief create a predictor wich customized outputs
* \param symbol_json_str The JSON string of the symbol.
* \param param_bytes The in-memory raw bytes of parameter ndarray file.
* \param param_size The size of parameter ndarray file.
* \param dev_type The device type, 1: cpu, 2:gpu
* \param dev_id The device id of the predictor.
* \param num_input_nodes Number of input nodes to the net,
* For feedforward net, this is 1.
* \param input_keys The name of input argument.
* For feedforward net, this is {"data"}
* \param input_shape_indptr Index pointer of shapes of each input node.
* The length of this array = num_input_nodes + 1.
* For feedforward net that takes 4 dimensional input, this is {0, 4}.
* \param input_shape_data A flatted data of shapes of each input node.
* For feedforward net that takes 4 dimensional input, this is the shape data.
* \param num_output_nodes Number of output nodes to the net,
* \param output_keys The name of output argument.
* For example {"global_pool"}
* \param out The created predictor handle.
* \return 0 when success, -1 when failure.
*/
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);
/*!
* \brief Get the shape of output node.
* The returned shape_data and shape_ndim is only valid before next call to MXPred function.
* \param handle The handle of the predictor.
* \param index The index of output node, set to 0 if there is only one output.
* \param shape_data Used to hold pointer to the shape data
* \param shape_ndim Used to hold shape dimension.
* \return 0 when success, -1 when failure.
*/
MXNET_DLL int MXPredGetOutputShape(PredictorHandle handle,
mx_uint index,
mx_uint** shape_data,
mx_uint* shape_ndim);
/*!
* \brief Set the input data of predictor.
* \param handle The predictor handle.
* \param key The name of input node to set.
* For feedforward net, this is "data".
* \param data The pointer to the data to be set, with the shape specified in MXPredCreate.
* \param size The size of data array, used for safety check.
* \return 0 when success, -1 when failure.
*/
MXNET_DLL int MXPredSetInput(PredictorHandle handle,
const char* key,
const mx_float* data,
mx_uint size);
/*!
* \brief Run a forward pass to get the output.
* \param handle The handle of the predictor.
* \return 0 when success, -1 when failure.
*/
MXNET_DLL int MXPredForward(PredictorHandle handle);
/*!
* \brief Run a interactive forward pass to get the output.
* This is helpful for displaying progress of prediction which can be slow.
* User must call PartialForward from step=0, keep increasing it until step_left=0.
* \code
* int step_left = 1;
* for (int step = 0; step_left != 0; ++step) {
* MXPredPartialForward(handle, step, &step_left);
* printf("Current progress [%d/%d]\n", step, step + step_left + 1);
* }
* \endcode
* \param handle The handle of the predictor.
* \param step The current step to run forward on.
* \param step_left The number of steps left
* \return 0 when success, -1 when failure.
*/
MXNET_DLL int MXPredPartialForward(PredictorHandle handle, int step, int* step_left);
/*!
* \brief Get the output value of prediction.
* \param handle The handle of the predictor.
* \param index The index of output node, set to 0 if there is only one output.
* \param data User allocated data to hold the output.
* \param size The size of data array, used for safe checking.
* \return 0 when success, -1 when failure.
*/
MXNET_DLL int MXPredGetOutput(PredictorHandle handle,
mx_uint index,
mx_float* data,
mx_uint size);
/*!
* \brief Free a predictor handle.
* \param handle The handle of the predictor.
* \return 0 when success, -1 when failure.
*/
MXNET_DLL int MXPredFree(PredictorHandle handle);
/*!
* \brief Create a NDArray List by loading from ndarray file.
* This can be used to load mean image file.
* \param nd_file_bytes The byte contents of nd file to be loaded.
* \param nd_file_size The size of the nd file to be loaded.
* \param out The out put NDListHandle
* \param out_length Length of the list.
* \return 0 when success, -1 when failure.
*/
MXNET_DLL int MXNDListCreate(const char* nd_file_bytes,
int nd_file_size,
NDListHandle *out,
mx_uint* out_length);
/*!
* \brief Get an element from list
* \param handle The handle to the NDArray
* \param index The index in the list
* \param out_key The output key of the item
* \param out_data The data region of the item
* \param out_shape The shape of the item.
* \param out_ndim The number of dimension in the shape.
* \return 0 when success, -1 when failure.
*/
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);
/*!
* \brief Free a MXAPINDList
* \param handle The handle of the MXAPINDList.
* \return 0 when success, -1 when failure.
*/
MXNET_DLL int MXNDListFree(NDListHandle handle);
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // MXNET_C_PREDICT_API_H_
[
{ "tag": "typedef", "ns": 0, "name": "mx_uint", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:26:22", "type": { "tag": ":unsigned-int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "mx_float", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:28:15", "type": { "tag": ":float", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "PredictorHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:30:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "typedef", "ns": 0, "name": "NDListHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:32:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "function", "name": "MXGetLastError", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:38:23", "variadic": false, "inline": false, "storage-class": "none", "parameters": [], "return-type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } },
{ "tag": "function", "name": "MXPredCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:59:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredCreatePartialOut", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:92:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "num_output_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "output_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutputShape", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:112:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "shape_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "shape_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredSetInput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:125:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "key", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:134:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredPartialForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:151:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "step", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "step_left", "type": { "tag": ":pointer", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:160:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:169:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:179:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "nd_file_bytes", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "nd_file_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "NDListHandle" } } }, { "tag": "parameter", "name": "out_length", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListGet", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:193:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "out_key", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } } }, { "tag": "parameter", "name": "out_shape", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "out_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:204:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "const", "name": "MXNET_DLL", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:22:9", "type": { "tag": ":long", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "const", "name": "MXNET_C_PREDICT_API_H_", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:8:9", "type": { "tag": ":long", "bit-size": 32, "bit-alignment": 32 } }
]
[
{ "tag": "typedef", "ns": 0, "name": "mx_uint", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:26:22", "type": { "tag": ":unsigned-int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "mx_float", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:28:15", "type": { "tag": ":float", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "PredictorHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:30:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "typedef", "ns": 0, "name": "NDListHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:32:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "function", "name": "MXGetLastError", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:38:23", "variadic": false, "inline": false, "storage-class": "none", "parameters": [], "return-type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } },
{ "tag": "function", "name": "MXPredCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:59:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredCreatePartialOut", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:92:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "num_output_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "output_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutputShape", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:112:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "shape_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "shape_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredSetInput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:125:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "key", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:134:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredPartialForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:151:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "step", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "step_left", "type": { "tag": ":pointer", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:160:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:169:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:179:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "nd_file_bytes", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "nd_file_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "NDListHandle" } } }, { "tag": "parameter", "name": "out_length", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListGet", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:193:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "out_key", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } } }, { "tag": "parameter", "name": "out_shape", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "out_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:204:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "const", "name": "MXNET_C_PREDICT_API_H_", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:8:9", "type": { "tag": ":long", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "const", "name": "MXNET_DLL", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:22:9", "type": { "tag": ":long", "bit-size": 32, "bit-alignment": 32 } }
]
[
{ "tag": "typedef", "ns": 0, "name": "mx_uint", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:26:22", "type": { "tag": ":unsigned-int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "mx_float", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:28:15", "type": { "tag": ":float", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "PredictorHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:30:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "typedef", "ns": 0, "name": "NDListHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:32:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "function", "name": "MXGetLastError", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:38:23", "variadic": false, "inline": false, "storage-class": "none", "parameters": [], "return-type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } },
{ "tag": "function", "name": "MXPredCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:59:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredCreatePartialOut", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:92:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "num_output_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "output_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutputShape", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:112:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "shape_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "shape_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredSetInput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:125:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "key", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:134:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredPartialForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:151:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "step", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "step_left", "type": { "tag": ":pointer", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:160:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:169:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:179:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "nd_file_bytes", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "nd_file_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "NDListHandle" } } }, { "tag": "parameter", "name": "out_length", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListGet", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:193:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "out_key", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } } }, { "tag": "parameter", "name": "out_shape", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "out_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:204:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "const", "name": "MXNET_C_PREDICT_API_H_", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:8:9", "type": { "tag": ":long", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "const", "name": "MXNET_DLL", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:22:9", "type": { "tag": ":long", "bit-size": 32, "bit-alignment": 32 } }
]
[
{ "tag": "typedef", "ns": 0, "name": "mx_uint", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:26:22", "type": { "tag": ":unsigned-int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "mx_float", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:28:15", "type": { "tag": ":float", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "PredictorHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:30:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "typedef", "ns": 0, "name": "NDListHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:32:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "function", "name": "MXGetLastError", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:38:23", "variadic": false, "inline": false, "storage-class": "none", "parameters": [], "return-type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } },
{ "tag": "function", "name": "MXPredCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:59:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredCreatePartialOut", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:92:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "num_output_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "output_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutputShape", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:112:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "shape_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "shape_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredSetInput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:125:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "key", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:134:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredPartialForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:151:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "step", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "step_left", "type": { "tag": ":pointer", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:160:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:169:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:179:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "nd_file_bytes", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "nd_file_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "NDListHandle" } } }, { "tag": "parameter", "name": "out_length", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListGet", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:193:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "out_key", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } } }, { "tag": "parameter", "name": "out_shape", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "out_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:204:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "const", "name": "MXNET_C_PREDICT_API_H_", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:8:9", "type": { "tag": ":long", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "const", "name": "MXNET_DLL", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:19:9", "type": { "tag": ":long", "bit-size": 32, "bit-alignment": 32 } }
]
[
{ "tag": "typedef", "ns": 0, "name": "mx_uint", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:26:22", "type": { "tag": ":unsigned-int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "mx_float", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:28:15", "type": { "tag": ":float", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "PredictorHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:30:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "typedef", "ns": 0, "name": "NDListHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:32:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "function", "name": "MXGetLastError", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:38:23", "variadic": false, "inline": false, "storage-class": "none", "parameters": [], "return-type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } },
{ "tag": "function", "name": "MXPredCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:59:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredCreatePartialOut", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:92:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "num_output_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "output_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutputShape", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:112:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "shape_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "shape_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredSetInput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:125:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "key", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:134:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredPartialForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:151:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "step", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "step_left", "type": { "tag": ":pointer", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:160:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:169:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:179:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "nd_file_bytes", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "nd_file_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "NDListHandle" } } }, { "tag": "parameter", "name": "out_length", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListGet", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:193:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "out_key", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } } }, { "tag": "parameter", "name": "out_shape", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "out_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:204:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "const", "name": "MXNET_C_PREDICT_API_H_", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:8:9", "type": { "tag": ":long", "bit-size": 64, "bit-alignment": 64 } },
{ "tag": "const", "name": "MXNET_DLL", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:22:9", "type": { "tag": ":long", "bit-size": 64, "bit-alignment": 64 } }
]
[
{ "tag": "typedef", "ns": 0, "name": "mx_uint", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:26:22", "type": { "tag": ":unsigned-int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "mx_float", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:28:15", "type": { "tag": ":float", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "PredictorHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:30:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "typedef", "ns": 0, "name": "NDListHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:32:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "function", "name": "MXGetLastError", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:38:23", "variadic": false, "inline": false, "storage-class": "none", "parameters": [], "return-type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } },
{ "tag": "function", "name": "MXPredCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:59:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredCreatePartialOut", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:92:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "num_output_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "output_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutputShape", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:112:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "shape_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "shape_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredSetInput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:125:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "key", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:134:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredPartialForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:151:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "step", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "step_left", "type": { "tag": ":pointer", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:160:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:169:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:179:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "nd_file_bytes", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "nd_file_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "NDListHandle" } } }, { "tag": "parameter", "name": "out_length", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListGet", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:193:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "out_key", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } } }, { "tag": "parameter", "name": "out_shape", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "out_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:204:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "const", "name": "MXNET_DLL", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:22:9", "type": { "tag": ":long", "bit-size": 64, "bit-alignment": 64 } },
{ "tag": "const", "name": "MXNET_C_PREDICT_API_H_", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:8:9", "type": { "tag": ":long", "bit-size": 64, "bit-alignment": 64 } }
]
[
{ "tag": "typedef", "ns": 0, "name": "mx_uint", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:26:22", "type": { "tag": ":unsigned-int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "mx_float", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:28:15", "type": { "tag": ":float", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "PredictorHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:30:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "typedef", "ns": 0, "name": "NDListHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:32:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "function", "name": "MXGetLastError", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:38:23", "variadic": false, "inline": false, "storage-class": "none", "parameters": [], "return-type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } },
{ "tag": "function", "name": "MXPredCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:59:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredCreatePartialOut", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:92:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "num_output_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "output_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutputShape", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:112:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "shape_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "shape_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredSetInput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:125:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "key", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:134:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredPartialForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:151:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "step", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "step_left", "type": { "tag": ":pointer", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:160:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:169:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:179:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "nd_file_bytes", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "nd_file_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "NDListHandle" } } }, { "tag": "parameter", "name": "out_length", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListGet", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:193:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "out_key", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } } }, { "tag": "parameter", "name": "out_shape", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "out_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:204:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "const", "name": "MXNET_DLL", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:19:9", "type": { "tag": ":long", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "const", "name": "MXNET_C_PREDICT_API_H_", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:8:9", "type": { "tag": ":long", "bit-size": 32, "bit-alignment": 32 } }
]
[
{ "tag": "typedef", "ns": 0, "name": "mx_uint", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:26:22", "type": { "tag": ":unsigned-int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "mx_float", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:28:15", "type": { "tag": ":float", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "typedef", "ns": 0, "name": "PredictorHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:30:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "typedef", "ns": 0, "name": "NDListHandle", "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:32:15", "type": { "tag": ":pointer", "type": { "tag": ":void" } } },
{ "tag": "function", "name": "MXGetLastError", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:38:23", "variadic": false, "inline": false, "storage-class": "none", "parameters": [], "return-type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } },
{ "tag": "function", "name": "MXPredCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:59:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredCreatePartialOut", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:92:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "symbol_json_str", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "param_bytes", "type": { "tag": ":pointer", "type": { "tag": ":void" } } }, { "tag": "parameter", "name": "param_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_type", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "dev_id", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "num_input_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "input_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "input_shape_indptr", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "input_shape_data", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }, { "tag": "parameter", "name": "num_output_nodes", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "output_keys", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "PredictorHandle" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutputShape", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:112:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "shape_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "shape_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredSetInput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:125:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "key", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:134:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredPartialForward", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:151:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "step", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "step_left", "type": { "tag": ":pointer", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredGetOutput", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:160:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "data", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } }, { "tag": "parameter", "name": "size", "type": { "tag": "mx_uint" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXPredFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:169:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "PredictorHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListCreate", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:179:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "nd_file_bytes", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } }, { "tag": "parameter", "name": "nd_file_size", "type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } }, { "tag": "parameter", "name": "out", "type": { "tag": ":pointer", "type": { "tag": "NDListHandle" } } }, { "tag": "parameter", "name": "out_length", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListGet", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:193:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }, { "tag": "parameter", "name": "index", "type": { "tag": "mx_uint" } }, { "tag": "parameter", "name": "out_key", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": ":char", "bit-size": 8, "bit-alignment": 8 } } } }, { "tag": "parameter", "name": "out_data", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_float" } } } }, { "tag": "parameter", "name": "out_shape", "type": { "tag": ":pointer", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } } }, { "tag": "parameter", "name": "out_ndim", "type": { "tag": ":pointer", "type": { "tag": "mx_uint" } } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "function", "name": "MXNDListFree", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:204:15", "variadic": false, "inline": false, "storage-class": "none", "parameters": [{ "tag": "parameter", "name": "handle", "type": { "tag": "NDListHandle" } }], "return-type": { "tag": ":int", "bit-size": 32, "bit-alignment": 32 } },
{ "tag": "const", "name": "MXNET_DLL", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:22:9", "type": { "tag": ":long", "bit-size": 64, "bit-alignment": 64 } },
{ "tag": "const", "name": "MXNET_C_PREDICT_API_H_", "ns": 0, "location": "/Users/ungil/lisp/mxnet/ffi-mxnet/c_predict_api.h:8:9", "type": { "tag": ":long", "bit-size": 64, "bit-alignment": 64 } }
]
(in-package #:asdf)
(defsystem #:mxnet-predict
:name "mxnet-predict"
:author "Carlos Ungil <ungil@mac.com>"
:license "Apache License, Version 2.0"
:description "Common Lisp interface to https://github.com/dmlc/mxnet"
:depends-on (:cffi :cl-autowrap :trivial-garbage)
:serial t
:components ((:module #:ffi :pathname "ffi" :components ((:static-file "c_predict_api.h")))
(:file "package-predict")
(:file "wrapper-predict")
(:file "predict")))
(defpackage #:mxnet.predict
(:use #:cl)
(:nicknames #:mxpred)
(:export "PREDICTOR" "FORWARD" "GET-OUTPUT"))
(defpackage #:mxnet.predict.ffi
(:nicknames #:mxpred.ffi))
(in-package :mxnet.predict)
(defun check-errors (x)
(unless (zerop x)
(error "~A" (mxpred.ffi:mx-get-last-error))))
(defvar *predictors*
(tg:make-weak-hash-table :weakness :value))
(defclass predictor ()
((pointer :initarg :pointer :accessor pointer)))
(defun free-predictor (handle)
(if (cffi:null-pointer-p handle)
(warn "tried to free a null pointer")
(check-errors (mxpred.ffi:mx-pred-free handle))))
(defun predictor (json params inputs &key (dev-type :cpu) (dev-id 0))
"each input is a list of the form (name batch dim1 dim2 ....)"
(assert (member dev-type '(:cpu :gpu)))
(let ((dev-type (if (symbolp dev-type) (ecase dev-type (:cpu 1) (:gpu 2)) dev-type))
(num-input-nodes (length inputs))
(input-names (mapcar #'first inputs))
(input-dims (mapcar #'rest inputs)))
(cffi:with-foreign-objects ((handle :pointer)
(params-array :unsigned-char (length params))
(keys :pointer num-input-nodes)
(shape-indptr :unsigned-int (1+ num-input-nodes))
(shape-data :unsigned-int (loop for dims in input-dims sum (length dims))))
(loop for i from 0 for name in input-names
do (setf (cffi:mem-aref keys :pointer i) (cffi:foreign-string-alloc name)))
(loop for i below (length params)
do (setf (cffi:mem-aref params-array :unsigned-char i) (aref params i)))
(loop for i from 0
for idx in (cons 0 (loop for dims in input-dims with sum = 0 collect (incf sum (length dims))))
do (setf (cffi:mem-aref shape-indptr :unsigned-int i) idx))
(loop for i from 0
for dim in (apply #'append input-dims)
do (setf (cffi:mem-aref shape-data :unsigned-int i) dim))
(check-errors (mxpred.ffi:mx-pred-create json params-array (length params) dev-type dev-id
num-input-nodes keys shape-indptr shape-data handle))
(loop for i below num-input-nodes
do (cffi:foreign-string-free (cffi:mem-aref keys :pointer i)))
(let ((predictor (make-instance 'predictor :pointer (cffi:mem-ref handle :pointer))))
(tg:finalize predictor (lambda () (free-predictor handle)))
(setf (gethash handle *predictors*) predictor)))))
(defmethod forward ((predictor predictor) data)
(loop for (k v) in data
do (cffi:with-foreign-object (data-array :float (length v))
(loop for i from 0 below (length v)
do (setf (cffi:mem-aref data-array :float i) (aref v i)))
(check-errors (mxpred.ffi:mx-pred-set-input (pointer predictor) k data-array (length v)))))
(check-errors (mxpred.ffi:mx-pred-forward (pointer predictor))))
(defmethod get-output-shape ((predictor predictor) index)
(cffi:with-foreign-objects ((shape-data :pointer) (shape-ndim :unsigned-int))
(check-errors (mxpred.ffi:mx-pred-get-output-shape (pointer predictor) index shape-data shape-ndim))
(loop for i below (cffi:mem-ref shape-ndim :unsigned-int)
collect (cffi:mem-aref (cffi:mem-ref shape-data :pointer) :unsigned-int i))))
(defmethod get-output ((predictor predictor) &optional (index 0))
(let* ((dims (get-output-shape predictor index))
(size (reduce #'* dims)))
(cffi:with-foreign-object (output-data :float size)
(check-errors (mxpred.ffi:mx-pred-get-output (pointer predictor) index output-data size))
(loop for i from 0 below size collect (cffi:mem-aref output-data :float i)))))
;; not implemented : MXPredCreatePartialOut MXPredPartialForward MXNDListCreate MXNDListGet MXNDListFree
;; to regenerate the autowrap definitions, delete or rename the .spec files
;; requires LLVM/Clang and c2ffi https://github.com/rpav/c2ffi
;; ffi/c_predict_api.h and ffi/c_api.h come from include/mxnet in the mxnet sources
(cffi:load-foreign-library "~/mxnet/lib/libmxnet.so")
(cl:in-package :mxnet.predict.ffi)
(autowrap:c-include '(mxnet-predict ffi "c_predict_api.h") :spec-path '(mxnet-predict ffi))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment