class_docstr: :class:`AbstractDataLoader` is an abstract object which would return a batch of data which is loaded by
  :class:`~recbole.data.interaction.Interaction` when it is iterated.
  And it is also the ancestor of all other dataloader.
  
  Args:
      config (Config): The config of dataloader.
      dataset (Dataset): The dataset of dataloader.
      sampler (Sampler): The sampler of dataloader.
      shuffle (bool, optional): Whether the dataloader will be shuffle after a round. Defaults to ``False``.
  
  Attributes:
      _dataset (Dataset): The dataset of this dataloader.
      shuffle (bool): If ``True``, dataloader will shuffle before every epoch.
      pr (int): Pointer of dataloader.
      step (int): The increment of :attr:`pr` for each batch.
      _batch_size (int): The max interaction number for all batch.
class_docstr_tok: [":","class",":","`","AbstractDataLoader","`","is","an","abstract","object","which","would","return","a","batch","of","data","which","is","loaded","by",":","class",":","`","~recbole.data.interaction.Interaction","`","when","it","is","iterated",".","And","it","is","also","the","ancestor","of","all","other","dataloader",".","Args",":","config","(","Config",")",":","The","config","of","dataloader",".","dataset","(","Dataset",")",":","The","dataset","of","dataloader",".","sampler","(","Sampler",")",":","The","sampler","of","dataloader",".","shuffle","(","bool",",","optional",")",":","Whether","the","dataloader","will","be","shuffle","after","a","round",".","Defaults","to","``","False","``",".","Attributes",":","_dataset","(","Dataset",")",":","The","dataset","of","this","dataloader",".","shuffle","(","bool",")",":","If","``","True","``",",","dataloader","will","shuffle","before","every","epoch",".","pr","(","int",")",":","Pointer","of","dataloader",".","step","(","int",")",":","The","increment","of",":","attr",":","`","pr","`","for","each","batch",".","_batch_size","(","int",")",":","The","max","interaction","number","for","all","batch","."]
code: def __init__(self, config, dataset, sampler, shuffle=False):
      self.shuffle = shuffle
      self.config = config
      self._dataset = dataset
      self._sampler = sampler
      self._batch_size = self.step = self.model = None
      self._init_batch_size_and_step()
      index_sampler = None
      self.generator = torch.Generator()
      self.generator.manual_seed(config["seed"])
      self.transform = construct_transform(config)
      self.is_sequential = config["MODEL_TYPE"] == ModelType.SEQUENTIAL
      if not config["single_spec"]:
          index_sampler = (
              torch.utils.data.distributed.DistributedSampler(
                  list(range(self.sample_size)),
                  shuffle=shuffle,
                  drop_last=False,
              )
          )
          self.step = max(1, self.step // config["world_size"])
          shuffle = False
      super().__init__(
          dataset=list(range(self.sample_size)),
          batch_size=self.step,
          collate_fn=self.collate_fn,
          num_workers=config["worker"],
          shuffle=shuffle,
          sampler=index_sampler,
          generator=self.generator,
      )
  
imports: import math
  import copy
  from logging import getLogger
  import torch
  from recbole.data.interaction import Interaction
  from recbole.utils import InputType, FeatureType, FeatureSource, ModelType
  from recbole.data.transform import construct_transform
label_desc: Use image node_id 1 to create a new AbstractDataLoader object from inherited base classes: torch.utils.data with example: obj = AbstractDataLoader(config, dataset, sampler, shuffle)