class_docstr: Handles iterating over epoch-level `tp.Iterator` objects.
class_docstr_tok: ["Handles","iterating","over","epoch-level","`","tp.Iterator","`","objects","."]
docstr: Infers steps_per_epoch needed to loop through a dataset.
docstr_tok: ["Infers","steps_per_epoch","needed","to","loop","through","a","dataset","."]
code: def _infer_steps(self, steps, dataset):
      """Infers steps_per_epoch needed to loop through a dataset."""
      if steps is not None:
          return steps
  
      adapter_steps = self._adapter.get_size()
      if adapter_steps is not None:
          return adapter_steps
  
      raise ValueError(
          "When passing a generator, you "
          "must specify how many steps to draw."
      )
  
file_path: elegy/elegy/data/data_handler.py
imports: import contextlib
  import logging
  from .array_adapter import ArrayDataAdapter
  from .dataset import DataLoaderAdapter
  from .generator_adapter import GeneratorDataAdapter
  from .list_adapter import ListsOfScalarsDataAdapter
label_desc: Use image node_id 6 for calling the DataHandler obj's underlying member method code with example usage: obj._infer_steps(steps, dataset) and returns: steps, adapter_steps