class_docstr: Same as BatchedDataLoader except it only loads upto capacity rows into memory.
  This class doesn't allow to be used multiple-times, so it doesn't inherit LoaderBase.
docstr: 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.
code: 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
      )
  
imports: import collections.abc
  import decimal
  import re
  import logging
  import numpy
  from six import PY2
  from torch.utils.data.dataloader import default_collate
  import torch
  from packaging import version
  from petastorm.reader_impl.shuffling_buffer import RandomShufflingBuffer, NoopShufflingBuffer
  from petastorm.reader_impl.pytorch_shuffling_buffer import BatchedRandomShufflingBuffer, BatchedNoopShufflingBuffer
label_desc: Use image node_id 1 to create a new InMemBatchedDataLoader object from inherited base classes: object with example: obj = InMemBatchedDataLoader(reader, batch_size, transform_fn, num_epochs, seed, rows_capacity, shuffle)