def __init__(self, reader, batch_size=1,
                 transform_fn=None,
                 num_epochs=1,
                 seed=0,
                 rows_capacity=1024,
                 shuffle=False):
        """
        Initializes a data loader object.
        This class does not support special types that are not supported in PyTorch (decimal/string).
        :param reader: petastorm Reader instance, which is stopped once all required data is loaded.
        :param batch_size: the number of items to return per batch; factored into the len() of this reader
        :param transform_fn: an optional callable to convert batches from the reader to PyTorch tensors
        :param num_epochs: number of epochs.
        :param seed: random seed used to shuffle.
        :param rows_capacity: number of rows to be loaded into memory.
        :param shuffle: If ``True``, indices will be shuffled in every epoch.
        """
        super(InMemBatchedDataLoader, self).__init__()
        self._batch_size = batch_size
        self._num_epochs = num_epochs
        self._seed = seed
        self._shuffle = shuffle
        self._in_iter = False
        # keys is a dict_keys storing column names and buffer is a list storing corresponding rows/tensors.
        self._keys, self._buffer = _load_rows_into_mem(reader, transform_fn or torch.as_tensor, rows_capacity)

        Initializes a data loader object.
        This class does not support special types that are not supported in PyTorch (decimal/string).
        :param reader: petastorm Reader instance, which is stopped once all required data is loaded.
        :param batch_size: the number of items to return per batch; factored into the len() of this reader
        :param transform_fn: an optional callable to convert batches from the reader to PyTorch tensors
        :param num_epochs: number of epochs.
        :param seed: random seed used to shuffle.
        :param rows_capacity: number of rows to be loaded into memory.
        :param shuffle: If ``True``, indices will be shuffled in every epoch.
        
petastorm/pytorch.py