code: def __init__(
      self,
      reader,
      batch_size,
      num_epochs,
      name="",
      shuffle=False,
      limit_step_per_epoch=-1,
      verbose=False,
  ):
      self.batch_size = batch_size
      self.limit_step_per_epoch = limit_step_per_epoch
      self.name = name
      self.verbose = verbose
  
      if limit_step_per_epoch == -1:
          raise ValueError(
              "limit_step_per_epoch cannot be -1 for inmem dataloader"
          )
  
      print(
          f"[{self.name}]: Initializing petastorm inmem_dataloader with batch_size={batch_size}"
          f"num_epochs={num_epochs}, "
          f"shuffle={shuffle}"
          f"limit_step_per_epoch={limit_step_per_epoch}"
      )
  
      self.dataloader = InMemBatchedDataLoader(
          reader,
          batch_size=batch_size,
          num_epochs=num_epochs,
          rows_capacity=batch_size * limit_step_per_epoch,
          shuffle=shuffle,
      )
      self.iterator = iter(self.dataloader)
  
imports: from petastorm.pytorch import BatchedDataLoader, InMemBatchedDataLoader
  from horovod.data import BaseDataLoader, AsyncDataLoaderMixin
label_desc: Use image node_id 1 to create a new PytorchInmemDataLoader object from inherited base classes: BaseDataLoader with example: obj = PytorchInmemDataLoader(reader, batch_size, num_epochs, name, shuffle, limit_step_per_epoch, verbose)