class_docstr: Loops an underlying iterable indefinitely, with nominal epoch lengths
  
  This is useful for working with IterableDatasets, and particularly
  webdataset-style loading. We recommend using ``.repeat()`` on the
  webdataset IterableDataset instance, so that the underlying dataloader
  naturally continues for ever.
  
  Arguments
  ---------
  loader : iterable
      A DataLoader or other iterable that is looped repeatedly.
  epoch_length : int
      The length of the nominal epoch. After this many steps, raises
      StopIteration
class_docstr_tok: ["Loops","an","underlying","iterable","indefinitely",",","with","nominal","epoch","lengths","This","is","useful","for","working","with","IterableDatasets",",","and","particularly","webdataset-style","loading",".","We","recommend","using","``",".repeat","(",")","``","on","the","webdataset","IterableDataset","instance",",","so","that","the","underlying","dataloader","naturally","continues","for","ever",".","Arguments","--","--","--","--","-","loader",":","iterable","A","DataLoader","or","other","iterable","that","is","looped","repeatedly",".","epoch_length",":","int","The","length","of","the","nominal","epoch",".","After","this","many","steps",",","raises","StopIteration"]
docstr: Loads the needed information.
docstr_tok: ["Loads","the","needed","information","."]
code: def load(self, path, end_of_epoch=True):
      """Loads the needed information."""
      with open(path) as fi:
          self.step = int(fi.readline().strip())
          self.total_steps = int(fi.readline().strip())
          self.total_samples = int(fi.readline().strip())
          if (
              not end_of_epoch
              and self.step == 0
              and self.total_steps > 0
          ):
              # Step has been set to 0 at the end of iteration,
              # so return it to epoch_length, so that first iteration
              # of this will immediately raise StopIteration.
              # Basically, this can happen when e.g. the main training
              # loop has already finished but there is a checkpoint in the
              # middle of validation.
              self.step = self.epoch_length
  
imports: from torch.utils.data import DataLoader
  from torch.utils.data import IterableDataset
  from torch.utils.data.dataloader import _BaseDataLoaderIter
  import logging
  import warnings
  import functools
  from torch.utils.data import DistributedSampler
  from speechbrain.dataio.batch import PaddedBatch, BatchsizeGuesser
  from speechbrain.dataio.dataset import DynamicItemDataset
  from speechbrain.dataio.sampler import ReproducibleRandomSampler, DistributedSamplerWrapper
  from speechbrain.utils.checkpoints import register_checkpoint_hooks, mark_as_saver, mark_as_loader
label_desc: Use image node_id 6 for calling the LoopedLoader obj's underlying member method code with example usage: obj.load(path, end_of_epoch) without return types