code: def testSparseWithDistributedDataset(self, sparse_factory):
      @def_function.function
      def distributed_dataset_producer(t):
          strategy = mirrored_strategy.MirroredStrategy(
              ["GPU:0", "GPU:1"]
          )
          sparse_ds = dataset_ops.Dataset.from_tensor_slices(t).batch(2)
          dist_dataset = strategy.experimental_distribute_dataset(
              sparse_ds
          )
          ds = iter(dist_dataset)
          result = strategy.experimental_local_results(next(ds))[0]
          # Reach the end of the iterator
          for ignore in ds:  # pylint: disable=unused-variable
              pass
          return result
  
      t = sparse_factory()
  
      result = distributed_dataset_producer(t)
      self.assertAllEqual(
          self.evaluate(sparse_ops.sparse_tensor_to_dense(t)[0]),
          self.evaluate(sparse_ops.sparse_tensor_to_dense(result)[0]),
      )
  
file_path: tensorflow/tensorflow/python/ops/factory_ops_test.py
imports: from absl.testing import parameterized
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.distribute import mirrored_strategy
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import sparse_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 1 for calling the FactoryOpsTest obj's underlying member method code with example usage: obj.testSparseWithDistributedDataset(sparse_factory) and returns: result