code: def testAgainstNumpy(self):
      # For 1 to 5 dimensions.
      for shape in (3,), (2, 2, 3), (4, 1, 2, 2), (8, 2, 10):
          rank = len(shape)
          expected = self.randn(shape, np.float32)
          for dtype in [np.bool_, np.float32, np.int32, np.int64]:
              # For all the possible axis to split it, including negative indices.
              for axis in range(-rank, rank):
                  test_arrays = np_split_squeeze(expected, axis)
  
                  with self.cached_session():
                      with self.subTest(
                          shape=shape, dtype=dtype, axis=axis
                      ):
                          actual_pack = array_ops_stack.stack(
                              test_arrays, axis=axis
                          )
                          self.assertEqual(
                              expected.shape, actual_pack.get_shape()
                          )
                          actual_pack = self.evaluate(actual_pack)
  
                          actual_stack = array_ops_stack.stack(
                              test_arrays, axis=axis
                          )
                          self.assertEqual(
                              expected.shape, actual_stack.get_shape()
                          )
                          actual_stack = self.evaluate(actual_stack)
  
                          self.assertNDArrayNear(
                              expected, actual_stack, 1e-6
                          )
  
imports: import numpy
  from tensorflow.python import tf2
  from tensorflow.python.eager import context
  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
  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 array_ops_stack
  from tensorflow.python.ops import gen_array_ops
  from tensorflow.python.ops import gradient_checker_v2
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 15 for calling the StackOpTest obj's underlying member method code with example usage: obj.testAgainstNumpy() without return types