docstr: Initializes a dataset generator.
  
  Args:
      data_generator_func: Callable that returns an iterable over the data to be batched, e.g. lambda: [1, 2, 3].
docstr_tok: ["Initializes","a","dataset","generator",".","Args",":","data_generator_func",":","Callable","that","returns","an","iterable","over","the","data","to","be","batched",",","e.g",".","lambda",":","[","1",",","2",",","3","]","."]
code: def __call__(
      self, data_generator_func: Callable[..., Iterable]
  ) -> tf.data.Dataset:
      """
      Initializes a dataset generator.
  
      Args:
          data_generator_func: Callable that returns an iterable over the data to be batched, e.g. lambda: [1, 2, 3].
      """
  
      dataset = tf.data.Dataset.from_generator(
          data_generator_func, self.tensor_types, self.tensor_shapes
      )
      if self.shuffle_buffer_size is not None:
          dataset = dataset.shuffle(self.shuffle_buffer_size)
      dataset = dataset.padded_batch(
          batch_size=self.batch_size,
          padded_shapes=self.tensor_shapes,
          drop_remainder=True,
      )
      return dataset
  
imports: from typing import Iterable, Callable
  import tensorflow
label_desc: Use image node_id 2 for calling the DatasetGenerator obj's underlying member method code with example usage: obj.__call__(data_generator_func) and returns: dataset