class_docstr: Adapter that handles `tf.data.Dataset`.
class_docstr_tok: ["Adapter","that","handles","`","tf.data.Dataset","`","."]
code: def get_numpy_iterator(self):
      from keras.utils.module_utils import tensorflow as tf
  
      def convert_to_numpy(x):
          if isinstance(x, tf.SparseTensor):
              x = tf.sparse.to_dense(x)
          # shared memory using `np.asarray`
          return np.asarray(x)
  
      for batch in self._dataset:
          yield tree.map_structure(convert_to_numpy, batch)
  
file_path: keras/keras/trainers/data_adapters/tf_dataset_adapter.py
imports: import numpy
  import tree
  from keras.trainers.data_adapters import data_adapter_utils
  from keras.trainers.data_adapters.data_adapter import DataAdapter
label_desc: Use image node_id 2 for calling the TFDatasetAdapter obj's underlying member method code with example usage: obj.get_numpy_iterator() and returns: np