@@ -81,6 +81,14 @@ typedef void *ExecutorHandle;
8181typedef void * DataIterCreator ;
8282/*! \brief handle to a DataIterator */
8383typedef void * DataIterHandle ;
84+ /*! \brief handle a dataset creator */
85+ typedef void * DatasetCreator ;
86+ /*! \brief handle to a Dataset */
87+ typedef void * DatasetHandle ;
88+ /*! \brief handle to a BatchifyFunction creator*/
89+ typedef void * BatchifyFunctionCreator ;
90+ /*! \brief handle to a BatchifyFunction */
91+ typedef void * BatchifyFunctionHandle ;
8492/*! \brief handle to KVStore */
8593typedef void * KVStoreHandle ;
8694/*! \brief handle to RecordIO */
@@ -2670,6 +2678,13 @@ MXNET_DLL int MXDataIterNext(DataIterHandle handle,
26702678 */
26712679MXNET_DLL int MXDataIterBeforeFirst (DataIterHandle handle );
26722680
2681+ /*!
2682+ * \brief Call iterator.GetLenHint. Note that some iterators don't provide length.
2683+ * \param handle the handle to iterator
2684+ * \return 0 when success, -1 when failure happens
2685+ */
2686+ MXNET_DLL int MXDataIterGetLenHint (DataIterHandle handle ,
2687+ int64_t * len );
26732688/*!
26742689 * \brief Get the handle to the NDArray of underlying data
26752690 * \param handle the handle pointer to the data iterator
@@ -2705,6 +2720,147 @@ MXNET_DLL int MXDataIterGetPadNum(DataIterHandle handle,
27052720 */
27062721MXNET_DLL int MXDataIterGetLabel (DataIterHandle handle ,
27072722 NDArrayHandle * out );
2723+ /*!
2724+ * \brief Get the handles to specified underlying ndarrays of index
2725+ * \param handle the handle pointer to the data iterator
2726+ * \param num_outputs the length of outputs
2727+ * \param out the handle to an array of NDArrays that stores pointers to handles
2728+ * \return 0 when success, -1 when failure happens
2729+ */
2730+ MXNET_DLL int MXDataIterGetItems (DataIterHandle handle ,
2731+ int * num_outputs ,
2732+ NDArrayHandle * * outputs );
2733+
2734+ /*!
2735+ * \brief List all the available dataset entries
2736+ * \param out_size the size of returned datasets
2737+ * \param out_array the output dataset entries
2738+ * \return 0 when success, -1 when failure happens
2739+ */
2740+ MXNET_DLL int MXListDatasets (uint32_t * out_size ,
2741+ DatasetCreator * * out_array );
2742+ /*!
2743+ * \brief Init an dataset, init with parameters
2744+ * the array size of passed in arguments
2745+ * \param handle of the dataset creator
2746+ * \param num_param number of parameter
2747+ * \param keys parameter keys
2748+ * \param vals parameter values
2749+ * \param out resulting dataset
2750+ * \return 0 when success, -1 when failure happens
2751+ */
2752+ MXNET_DLL int MXDatasetCreateDataset (DatasetCreator handle ,
2753+ uint32_t num_param ,
2754+ const char * * keys ,
2755+ const char * * vals ,
2756+ DatasetHandle * out );
2757+ /*!
2758+ * \brief Get the detailed information about dataset.
2759+ * \param creator the DatasetCreator.
2760+ * \param name The returned name of the creator.
2761+ * \param description The returned description of the symbol.
2762+ * \param num_args Number of arguments.
2763+ * \param arg_names Name of the arguments.
2764+ * \param arg_type_infos Type informations about the arguments.
2765+ * \param arg_descriptions Description information about the arguments.
2766+ * \return 0 when success, -1 when failure happens
2767+ */
2768+ MXNET_DLL int MXDatasetGetDatasetInfo (DatasetCreator creator ,
2769+ const char * * name ,
2770+ const char * * description ,
2771+ uint32_t * num_args ,
2772+ const char * * * arg_names ,
2773+ const char * * * arg_type_infos ,
2774+ const char * * * arg_descriptions );
2775+ /*!
2776+ * \brief Free the handle to the IO module
2777+ * \param handle the handle pointer to the dataset
2778+ * \return 0 when success, -1 when failure happens
2779+ */
2780+ MXNET_DLL int MXDatasetFree (DatasetHandle handle );
2781+ /*!
2782+ * \brief Get dataset overal length(size)
2783+ * \param handle the handle to dataset
2784+ * \param out return value of GetLen
2785+ * \return 0 when success, -1 when failure happens
2786+ */
2787+ MXNET_DLL int MXDatasetGetLen (DatasetHandle handle ,
2788+ uint64_t * out );
2789+ /*!
2790+ * \brief Get Output NDArray given specified indices
2791+ * \param handle the handle to dataset
2792+ * \param index the index of the dataset item to be retrieved
2793+ * \param num_outputs the number of output ndarrays
2794+ * \param outputs the pointers to handles of ndarrays
2795+ * \param is_scalar if not zeros then output should be casted to scalars
2796+ * \return 0 when success, -1 when failure happens
2797+ */
2798+ MXNET_DLL int MXDatasetGetItems (DatasetHandle handle ,
2799+ uint64_t index ,
2800+ int * num_outputs ,
2801+ NDArrayHandle * * outputs );
2802+
2803+ /*!
2804+ * \brief List all the available batchify function entries
2805+ * \param out_size the size of returned batchify functions
2806+ * \param out_array the output batchify function entries
2807+ * \return 0 when success, -1 when failure happens
2808+ */
2809+ MXNET_DLL int MXListBatchifyFunctions (uint32_t * out_size ,
2810+ BatchifyFunctionCreator * * out_array );
2811+ /*!
2812+ * \brief Init an batchify function, init with parameters
2813+ * the array size of passed in arguments
2814+ * \param handle of the batchify function creator
2815+ * \param num_param number of parameter
2816+ * \param keys parameter keys
2817+ * \param vals parameter values
2818+ * \param out resulting batchify function
2819+ * \return 0 when success, -1 when failure happens
2820+ */
2821+ MXNET_DLL int MXBatchifyFunctionCreateFunction (BatchifyFunctionCreator handle ,
2822+ uint32_t num_param ,
2823+ const char * * keys ,
2824+ const char * * vals ,
2825+ BatchifyFunctionHandle * out );
2826+ /*!
2827+ * \brief Get the detailed information about batchify function.
2828+ * \param creator the batchifyFunctionCreator.
2829+ * \param name The returned name of the creator.
2830+ * \param description The returned description of the symbol.
2831+ * \param num_args Number of arguments.
2832+ * \param arg_names Name of the arguments.
2833+ * \param arg_type_infos Type informations about the arguments.
2834+ * \param arg_descriptions Description information about the arguments.
2835+ * \return 0 when success, -1 when failure happens
2836+ */
2837+ MXNET_DLL int MXBatchifyFunctionGetFunctionInfo (BatchifyFunctionCreator creator ,
2838+ const char * * name ,
2839+ const char * * description ,
2840+ uint32_t * num_args ,
2841+ const char * * * arg_names ,
2842+ const char * * * arg_type_infos ,
2843+ const char * * * arg_descriptions );
2844+ /*!
2845+ * \brief Invoke the Batchify Function
2846+ * \param handle the handle pointer to the batchify function
2847+ * \param batch_size the batch size
2848+ * \param num_output the number of ndarrays for output
2849+ * \param inputs the pointers to input ndarrays
2850+ * \param ouptuts the pointers to output ndarrays
2851+ * \return 0 when success, -1 when failure happens
2852+ */
2853+ MXNET_DLL int MXBatchifyFunctionInvoke (BatchifyFunctionHandle handle ,
2854+ int batch_size ,
2855+ int num_output ,
2856+ NDArrayHandle * inputs ,
2857+ NDArrayHandle * * outputs );
2858+ /*!
2859+ * \brief Free the handle to the IO module
2860+ * \param handle the handle pointer to the batchify function
2861+ * \return 0 when success, -1 when failure happens
2862+ */
2863+ MXNET_DLL int MXBatchifyFunctionFree (BatchifyFunctionHandle handle );
27082864//--------------------------------------------
27092865// Part 6: basic KVStore interface
27102866//--------------------------------------------
0 commit comments