code: def test_constant_value_as_shape(self):
      x = np.array([1, 2, 3, 4], dtype=np.int32)
      s = tensorshape_util.constant_value_as_shape(x)
      self.assertIsInstance(s, tf.TensorShape)
      self.assertAllEqual(x, s)
  
      x = tf.Variable([3])
      s = tensorshape_util.constant_value_as_shape(x)
      # `s` could be `TensorShape(None)` or `TensorShape([None])`, depending on
      # whether or not we're executing eagerly.  We could improve
      # `constant_value_as_shape` to always return `TensorShape([None])`.
      self.assertFalse(s.is_fully_defined())
  
      self.assertEqual(
          tf.TensorShape(None),
          tensorshape_util.constant_value_as_shape(
              tf.Variable([7, 2], shape=tf.TensorShape([None]))
          ),
      )
  
file_path: probability/tensorflow_probability/python/internal/tensorshape_util_test.py
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 3 for calling the TensorShapeUtilTestTest obj's underlying member method code with example usage: obj.test_constant_value_as_shape() without return types