code: def testPartialShapeToTensorUnknownDimension(self):
      self.assertAllEqual(
          [-1],
          self.evaluate(
              convert.partial_shape_to_tensor(
                  tensor_shape.TensorShape([None])
              )
          ),
      )
      self.assertAllEqual(
          [-1], self.evaluate(convert.partial_shape_to_tensor((None,)))
      )
      self.assertAllEqual(
          [-1], self.evaluate(convert.partial_shape_to_tensor([None]))
      )
      self.assertAllEqual(
          [-1], self.evaluate(convert.partial_shape_to_tensor([-1]))
      )
      self.assertAllEqual(
          [-1],
          self.evaluate(
              convert.partial_shape_to_tensor(
                  constant_op.constant([-1], dtype=dtypes.int64)
              )
          ),
      )
  
      with self.assertRaisesRegex(
          ValueError,
          r"The given shape .* must be a 1-D tensor of `tf.int64` "
          r"values, but the shape was \(2, 2\).",
      ):
          convert.partial_shape_to_tensor(
              constant_op.constant([[1, 1], [1, 1]], dtype=dtypes.int64)
          )
  
      with self.assertRaisesRegex(
          TypeError,
          r"The given shape .* must be a 1-D tensor of `tf.int64` "
          r"values, but the element type was float32.",
      ):
          convert.partial_shape_to_tensor(
              constant_op.constant([1.0, 1.0])
          )
  
imports: from absl.testing import parameterized
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.util import convert
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.platform import test
  from tensorflow.python.util import compat
label_desc: Use image node_id 6 for calling the ConvertTest obj's underlying member method code with example usage: obj.testPartialShapeToTensorUnknownDimension() without return types