code: def test_tensorshape(self):
      self.assertAllEqual([0], ps.shape(tf.TensorShape([])))
      self.assertAllEqual([1], ps.shape(tf.TensorShape(3)))
      self.assertAllEqual([1], ps.shape(tf.TensorShape([2])))
      self.assertAllEqual([2], ps.shape(tf.TensorShape([19, 17])))
      self.assertAllEqual([3], ps.shape(tf.TensorShape([2, 1, 4])))
  
      with self.assertRaisesRegex(
          ValueError, "Cannot convert a partially known TensorShape"
      ):
          ps.shape(tf.TensorShape(None))
  
      with self.assertRaisesRegex(
          ValueError, "Cannot convert a partially known TensorShape"
      ):
          # Should we support this?  tf.shape fails on this input.
          ps.shape(tf.TensorShape([3, None, 4]))
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 7 for calling the ShapeTest obj's underlying member method code with example usage: obj.test_tensorshape() without return types