code: def testGradientsNegativeAxis(self):
      x1 = [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]
      x2 = [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]]
      inp_tensors = [
          constant_op.constant(x1, shape=(2, 3), dtype=dtypes.float32),
          constant_op.constant(x2, shape=(2, 3), dtype=dtypes.float32),
      ]
  
      # Test concat gradient with axis == -2
      self._testGradientsForAxis(inp_tensors, -2, output_shape=[4, 3])
  
      # Test concat gradient with unknown-shape tensors.
      x1_placeholder = array_ops.placeholder(dtypes.float32)
      x2_placeholder = array_ops.placeholder(dtypes.float32)
      inp_tensors_placeholders = [x1_placeholder, x2_placeholder]
      feed_dict = {x1_placeholder: x1, x2_placeholder: x2}
      self._testGradientsForAxis(
          inp_tensors_placeholders,
          -1,
          output_shape=[2, 6],
          feed_dict=feed_dict,
      )
  
      # Test IndexedSlices concat gradient.
      self._testIndexedSlicesGradientsForAxis(
          inp_tensors, -2, output_shape=[2, 3], gather_indexes=[2, 0]
      )
  
      # We don't support calculating IndexedSlices concat gradient for
      # negative indexes when rank is not known.
      with self.assertRaises(ValueError):
          self._testIndexedSlicesGradientsForAxis(
              inp_tensors_placeholders,
              -2,
              output_shape=[2, 3],
              gather_indexes=[2, 0],
              feed_dict=feed_dict,
          )
  
imports: import numpy
  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_impl
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_array_ops
  from tensorflow.python.ops import gradient_checker
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 38 for calling the ConcatOpTest obj's underlying member method code with example usage: obj.testGradientsNegativeAxis() without return types