code: def testAllGatherRaiseSparse(self, strategy, pure_eager):
      dense_shape = [5, 2]
      t0 = _make_indexed_slices(
          values=[[1.0, 2.0]], indices=[2], dense_shape=dense_shape
      )
  
      def replica_fn(value):
          ctx = distribute_lib.get_replica_context()
          return ctx.all_gather(value, axis=0)
  
      with self.assertRaisesRegex(
          NotImplementedError,
          r"all_gather does not support IndexedSlices",
      ):
          if not pure_eager:
              strategy.run(
                  def_function.function(replica_fn), args=(t0,)
              )
          else:
              strategy.run(replica_fn, args=(t0,))
  
imports: from absl.testing import parameterized
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.distribute import central_storage_strategy
  from tensorflow.python.distribute import combinations
  from tensorflow.python.distribute import distribute_lib
  from tensorflow.python.distribute import mirrored_strategy
  from tensorflow.python.distribute import strategy_combinations
  from tensorflow.python.distribute import test_util
  from tensorflow.python.distribute import tpu_strategy
  from tensorflow.python.distribute.collective_all_reduce_strategy import CollectiveAllReduceStrategy
  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 errors
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.platform import test
  from tensorflow.python.util import nest
label_desc: Use image node_id 26 for calling the GatherTest obj's underlying member method code with example usage: obj.testAllGatherRaiseSparse(strategy, pure_eager) and returns: ctx