code: def testMapAndBatchSparse(self):
      def _sparse(i):
          return sparse_tensor.SparseTensorValue(
              indices=[[0]], values=(i * [1]), dense_shape=[1]
          )
  
      dataset = dataset_ops.Dataset.range(10).apply(
          batching.map_and_batch(_sparse, 5)
      )
  
      self.assertDatasetProduces(
          dataset,
          expected_output=[
              sparse_tensor.SparseTensorValue(
                  indices=[[0, 0], [1, 0], [2, 0], [3, 0], [4, 0]],
                  values=[
                      i * 5,
                      i * 5 + 1,
                      i * 5 + 2,
                      i * 5 + 3,
                      i * 5 + 4,
                  ],
                  dense_shape=[5, 1],
              )
              for i in range(2)
          ],
      )
  
imports: import math
  from absl.testing import parameterized
  import numpy
  from tensorflow.python import pywrap_sanitizers
  from tensorflow.python.checkpoint import checkpoint
  from tensorflow.python.checkpoint import checkpoint_management
  from tensorflow.python.data.experimental.ops import batching
  from tensorflow.python.data.kernel_tests import checkpoint_test_base
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import options
  from tensorflow.python.eager import context
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import control_flow_util
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import script_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 6 for calling the MapAndBatchTest obj's underlying member method code with example usage: obj.testMapAndBatchSparse() and returns: sparse_tensor