code: def testShapeError(self):
      # Rank doesn't match.
      with self.assertRaises(ValueError):
          array_ops.concat(
              [
                  constant_op.constant(10.0, shape=[4, 4, 4, 4]),
                  constant_op.constant(20.0, shape=[4, 4, 4]),
              ],
              1,
          )
  
      # Dimensions don't match in a non-concat dim.
      with self.assertRaises(ValueError):
          array_ops.concat(
              [
                  constant_op.constant(10.0, shape=[1, 2, 1]),
                  constant_op.constant(20.0, shape=[3, 2, 1]),
              ],
              1,
          )
  
      # concat_dim out of range.
      with self.assertRaises(ValueError):
          array_ops.concat(
              [
                  constant_op.constant(10.0, shape=[4, 4, 4]),
                  constant_op.constant(20.0, shape=[4, 4, 4]),
              ],
              3,
          )
  
      # concat_dim out of range
      with self.assertRaises(ValueError):
          array_ops.concat(
              [
                  constant_op.constant(10.0, shape=[4, 4, 4]),
                  constant_op.constant(20.0, shape=[4, 4, 4]),
              ],
              -4,
          )
  
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 20 for calling the ConcatOpTest obj's underlying member method code with example usage: obj.testShapeError() without return types