code: def testUnknownShape(self):
      # Verify that input shape and paddings shape can be unknown.
      _ = array_ops.batch_to_space_nd(
          array_ops.placeholder(dtypes.float32),
          array_ops.placeholder(dtypes.int32, shape=(2,)),
          array_ops.placeholder(dtypes.int32),
      )
  
      # Only number of input dimensions is known.
      t = array_ops.batch_to_space_nd(
          array_ops.placeholder(
              dtypes.float32, shape=(None, None, None, None)
          ),
          array_ops.placeholder(dtypes.int32, shape=(2,)),
          array_ops.placeholder(dtypes.int32),
      )
      self.assertEqual(4, t.get_shape().ndims)
  
      # Dimensions are partially known.
      t = array_ops.batch_to_space_nd(
          array_ops.placeholder(
              dtypes.float32, shape=(None, None, None, 2)
          ),
          array_ops.placeholder(dtypes.int32, shape=(2,)),
          array_ops.placeholder(dtypes.int32),
      )
      self.assertEqual([None, None, None, 2], t.get_shape().as_list())
  
      # Dimensions are partially known.
      t = array_ops.batch_to_space_nd(
          array_ops.placeholder(
              dtypes.float32, shape=(3 * 2 * 3, None, None, 2)
          ),
          [2, 3],
          array_ops.placeholder(dtypes.int32),
      )
      self.assertEqual([3, None, None, 2], t.get_shape().as_list())
  
      # Dimensions are partially known.
      t = array_ops.batch_to_space_nd(
          array_ops.placeholder(
              dtypes.float32, shape=(3 * 2 * 3, None, 2, 2)
          ),
          [2, 3],
          [[1, 1], [0, 1]],
      )
      self.assertEqual([3, None, 5, 2], t.get_shape().as_list())
  
      # Dimensions are fully known.
      t = array_ops.batch_to_space_nd(
          array_ops.placeholder(
              dtypes.float32, shape=(3 * 2 * 3, 2, 1, 2)
          ),
          [2, 3],
          [[1, 1], [0, 0]],
      )
      self.assertEqual([3, 2, 3, 2], t.get_shape().as_list())
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  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.platform import test
label_desc: Use image node_id 10 for calling the BatchToSpaceNDErrorHandlingTest obj's underlying member method code with example usage: obj.testUnknownShape() without return types