class_docstr: Adapter that handles `tf.data.Dataset`.
code: def __init__(
      self, x, y=None, sample_weights=None, steps=None, **kwargs
  ):
      super().__init__(x, y, **kwargs)
      # Note that the dataset instance is immutable, its fine to reuse the user
      # provided dataset.
      self._dataset = x
  
      # The user-provided steps.
      self._user_steps = steps
  
      self._validate_args(y, sample_weights, steps)
  
      # Since we have to know the dtype of the dataset when we build the
      # dataset, we have to look at a batch to infer the structure.
      peek = next(iter(x))
  
      self._first_batch_size = int(list(flatten(peek))[0].shape[0])
  
file_path: elegy/elegy/data/tf_dataset_adapter.py
imports: from tensorflow.python.data.experimental.ops import cardinality
  from tensorflow.python.data.ops import dataset_ops
  from .data_adapter import DataAdapter
  from .utils import flatten, is_none_or_empty, map_structure
label_desc: Use image node_id 2 to create a new TFDatasetAdapter object from inherited base classes: DataAdapter with example: obj = TFDatasetAdapter(x, y, sample_weights, steps)