code: def _eval_indexed_slices(a):
      """Converts IndexedSlices to IndexedSlicesValue with numpy indices/values.
  
      When eager execution is enabled, converts IndexedSlices
      to IndexedSlicesValue with numpy indices/values.
  
      Args:
        a: any value.
  
      Returns:
        If a is IndexedSlices and eager execution is enabled, calls numpy() on a's
        fields. Otherwise returns a unchanged.
      """
      if (
          isinstance(a, indexed_slices.IndexedSlices)
          and context.executing_eagerly()
      ):
          return indexed_slices.IndexedSlicesValue(
              indices=[x.numpy() for x in a.indices],
              values=[x.numpy() for x in a.values],
              dense_shape=a.dense_shape,
          )
      return a
  
imports: import numpy
  from tensorflow.python.eager import backprop
  from tensorflow.python.eager import context
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 2 for calling a global function with example usage: _eval_indexed_slices(a) and returns: a, indexed_slices