27 #include <dmlc/data.h> 28 #include <dmlc/registry.h> 41 template<
typename DType>
48 virtual void Init(
const std::vector<std::pair<std::string, std::string> >& kwargs) = 0;
52 virtual bool Next(
void) = 0;
54 virtual const DType &
Value(
void)
const = 0;
61 data_names.push_back(data_name);
95 :
public dmlc::FunctionRegEntryBase<DataIteratorReg,
96 DataIteratorFactory> {
113 #define MXNET_REGISTER_IO_ITER(name) \ 114 DMLC_REGISTRY_REGISTER(::mxnet::DataIteratorReg, DataIteratorReg, name) 116 #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:58
void SetDataName(const std::string data_name)
set data name to each attribute of data
Definition: io.h:60
namespace of mxnet
Definition: base.h:126
std::string extra_data
extra data to be fed to the network
Definition: io.h:72
int num_batch_padd
num of example padded to batch
Definition: io.h:86
std::vector< uint64_t > index
index of image data
Definition: io.h:82
unsigned index
unique id for instance
Definition: io.h:68
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:84
iterator type
Definition: io.h:42
Registry entry for DataIterator factory functions.
Definition: io.h:94
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:56
virtual bool Next(void)=0
move to next item
DataBatch of NDArray, returned by Iterator.
Definition: io.h:78
a single data instance
Definition: io.h:66
std::vector< TBlob > data
content of data
Definition: io.h:70
virtual void BeforeFirst(void)=0
reset the iterator
std::vector< NDArray > data
content of dense data, if this DataBatch is dense
Definition: io.h:80
std::function< IIterator< DataBatch > *()> DataIteratorFactory
typedef the factory function of data iterator
Definition: io.h:90