'Args:
ds (DataFlow): Its components must be either scalars or :class:`np.ndarray`.
Each component has to be of the same shape across datapoints.
batch_size(int): batch size
remainder (bool): whether to return the remaining data smaller than a batch_size.
If set True, it will possibly generates a data point of a smaller batch size.
Otherwise, all generated data are guranteed to have the same size.
use_list (bool): if True, it will run faster by producing a list
of datapoints instead of an ndarray of datapoints, avoiding an
extra copy.'

def __init__(self, ds, batch_size, remainder=False, use_list=False):

    super(BatchData, self).__init__(ds)
    if (not remainder):
        try:
            assert (batch_size <= ds.size())
        except NotImplementedError:
            pass
    self.batch_size = batch_size
    self.remainder = remainder
    self.use_list = use_list
