32 #include "dmlc/data.h" 33 #include "dmlc/registry.h" 42 template<
typename DType>
49 virtual void Init(
const std::vector<std::pair<std::string, std::string> >& kwargs) = 0;
53 virtual bool Next(
void) = 0;
55 virtual const DType &
Value(
void)
const = 0;
62 data_names.push_back(data_name);
96 :
public dmlc::FunctionRegEntryBase<DataIteratorReg,
97 DataIteratorFactory> {
114 #define MXNET_REGISTER_IO_ITER(name) \ 115 DMLC_REGISTRY_REGISTER(::mxnet::DataIteratorReg, DataIteratorReg, name) 117 #endif // MXNET_IO_H_ std::vector< std::string > data_names
store the name of each data, it could be used for making NDArrays
Definition: io.h:59
void SetDataName(const std::string data_name)
set data name to each attribute of data
Definition: io.h:61
namespace of mxnet
Definition: base.h:89
std::string extra_data
extra data to be fed to the network
Definition: io.h:73
int num_batch_padd
num of example padded to batch
Definition: io.h:87
std::vector< uint64_t > index
index of image data
Definition: io.h:83
unsigned index
unique id for instance
Definition: io.h:69
virtual const DType & Value(void) const =0
get current data
std::string extra_data
extra data to be fed to the network
Definition: io.h:85
iterator type
Definition: io.h:43
Registry entry for DataIterator factory functions.
Definition: io.h:95
virtual void Init(const std::vector< std::pair< std::string, std::string > > &kwargs)=0
set the parameters and init iter
virtual ~IIterator(void)
constructor
Definition: io.h:57
virtual bool Next(void)=0
move to next item
DataBatch of NDArray, returned by Iterator.
Definition: io.h:79
a single data instance
Definition: io.h:67
std::vector< TBlob > data
content of data
Definition: io.h:71
virtual void BeforeFirst(void)=0
reset the iterator
std::vector< NDArray > data
content of dense data, if this DataBatch is dense
Definition: io.h:81
std::function< IIterator< DataBatch > *()> DataIteratorFactory
typedef the factory function of data iterator
Definition: io.h:91