Table Of Contents
Table Of Contents

class, size, reset_internal=True)[source]

Resize a data iterator to a given number of batches.

  • data_iter (DataIter) – The data iterator to be resized.
  • size (int) – The number of batches per epoch to resize to.
  • reset_internal (bool) – Whether to reset internal iterator on ResizeIter.reset.


>>> nd_iter =,10)), batch_size=25)
>>> resize_iter =, 2)
>>> for batch in resize_iter:
...     print(
[<NDArray 25x10 @cpu(0)>]
[<NDArray 25x10 @cpu(0)>]
__init__(data_iter, size, reset_internal=True)[source]

Initialize self. See help(type(self)) for accurate signature.


__init__(data_iter, size[, reset_internal]) Initialize self.
getdata() Get data of current batch.
getindex() Get index of the current batch.
getlabel() Get label of the current batch.
getpad() Get the number of padding examples in the current batch.
iter_next() Move to the next batch.
next() Get next data batch from iterator.
reset() Reset the iterator to the begin of the data.