code: def testPartialShapes(self):
      # Testing unknown shapes in graph building.
      with ops.Graph().as_default():
          x = array_ops.placeholder(dtypes.float32)
  
          # Unknown input shape, partial new shape.
          y = array_ops.reshape(x, [1, 1, -1, 1])
          self.assertEqual([1, 1, None, 1], y.get_shape().as_list())
  
          # Unknown input shape, unknown new shape.
          y = array_ops.reshape(x, array_ops.placeholder(dtypes.int32))
          self.assertEqual(None, y.get_shape().ndims)
  
          # Unknown input shape, known rank for new shape.
          y = array_ops.reshape(
              x, array_ops.placeholder(dtypes.int32, shape=(3,))
          )
          self.assertEqual([None, None, None], y.get_shape().as_list())
  
          # Unknown input shape, partial new shape using `tf.stack()`.
          y = array_ops.reshape(
              x, [array_ops.placeholder(dtypes.int32), 37]
          )
          self.assertEqual([None, 37], y.get_shape().as_list())
  
          # Unknown input shape, partial new shape using `tf.concat()`.
          y = array_ops.reshape(
              x,
              array_ops.concat(
                  [
                      array_ops.placeholder(dtypes.int32, shape=(2,)),
                      [37, 42],
                  ],
                  0,
              ),
          )
          self.assertEqual(
              [None, None, 37, 42], y.get_shape().as_list()
          )
  
          # Unknown input shape, partial new shape using `tf.shape()`.
          y = array_ops.reshape(
              x,
              array_ops.shape(
                  array_ops.placeholder(
                      dtypes.float32, shape=[None, 37, None]
                  )
              ),
          )
          self.assertEqual([None, 37, None], y.get_shape().as_list())
  
imports: import numpy
  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 tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gradient_checker_v2
  from tensorflow.python.platform import test
label_desc: Use image node_id 23 for calling the ReshapeTest obj's underlying member method code with example usage: obj.testPartialShapes() without return types