code: def _sharding_grad(op, grad):
      """Gradient for XlaSharding op."""
      sharding_attr = op.get_attr("sharding")
      grad_sharding = gen_xla_ops.xla_sharding(
          grad,
          sharding=sharding_attr,
          unspecified_dims=op.get_attr("unspecified_dims"),
      )
      # pylint: disable=protected-access
      grad_sharding.op._set_attr(
          "_XlaSharding", attr_value_pb2.AttrValue(s=sharding_attr)
      )
      return [grad_sharding]
  
imports: from tensorflow.compiler.tf2xla.ops import gen_xla_ops
  from local_xla.xla import xla_data_pb2
  from tensorflow.core.framework import attr_value_pb2
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import bitwise_ops
  from tensorflow.python.ops import gen_math_ops
  from tensorflow.python.ops import gen_random_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import random_ops_util
  from tensorflow.python.ops import special_math_ops
  from tensorflow.python.ops.numpy_ops import np_utils
label_desc: Use image node_id 20 for calling a global function with example usage: _sharding_grad(op, grad) and returns: list