code: def test_tf_sparse_tensors(self):
      def generate_tf():
          for i in range(4):
              x = tf.SparseTensor(
                  indices=[[0, 0], [1, 2]],
                  values=[1.0, 2.0],
                  dense_shape=(2, 4),
              )
              y = tf.SparseTensor(
                  indices=[[0, 0], [1, 1]],
                  values=[3.0, 4.0],
                  dense_shape=(2, 2),
              )
              yield x, y
  
      adapter = generator_data_adapter.GeneratorDataAdapter(
          generate_tf()
      )
      ds = adapter.get_tf_dataset()
      for batch in ds:
          self.assertEqual(len(batch), 2)
          bx, by = batch
          self.assertIsInstance(bx, tf.SparseTensor)
          self.assertIsInstance(by, tf.SparseTensor)
          self.assertEqual(bx.shape, (2, 4))
          self.assertEqual(by.shape, (2, 2))
  
file_path: keras/keras/trainers/data_adapters/generator_data_adapter_test.py
imports: import math
  import numpy
  import scipy
  import tensorflow
  from absl.testing import parameterized
  from keras import testing
  from keras.trainers.data_adapters import generator_data_adapter
label_desc: Use image node_id 2 for calling the GeneratorDataAdapterTest obj's underlying member method code with example usage: obj.test_tf_sparse_tensors() without return types