code: def _collective_permute_grad(op, grad):
      # The gradient of a collective permute operation is also a collective
      # permute, but with source/target pairs reversed. The gradient with respect
      # to input argument `source_target_pairs` is `None`.
      source_target_pairs = op.inputs[1][:, ::-1]
      return [
          gen_tpu_ops.collective_permute(grad, source_target_pairs),
          None,
      ]
  
imports: from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_tpu_ops
  from tensorflow.python.ops.gen_tpu_ops import *
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.tpu import tpu_function
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 6 for calling a global function with example usage: _collective_permute_grad(op, grad) and returns: list