code: def testFromPlaceholder(self):
      # This test needs a placeholder which means we need to construct a graph.
      with ops.Graph().as_default():
          unknown = array_ops.placeholder(dtypes.int64, name="unknown")
          partial = array_ops.placeholder(
              dtypes.float32, shape=[None, 1], name="partial"
          )
  
          spec_1 = tensor.TensorSpec.from_tensor(unknown)
          self.assertEqual(spec_1.dtype, dtypes.int64)
          self.assertEqual(spec_1.shape, None)
          self.assertEqual(spec_1.name, "unknown")
          spec_2 = tensor.TensorSpec.from_tensor(partial)
          self.assertEqual(spec_2.dtype, dtypes.float32)
          self.assertEqual(spec_2.shape.as_list(), [None, 1])
          self.assertEqual(spec_2.name, "partial")
  
imports: import pickle
  from absl.testing import parameterized
  import numpy
  from tensorflow.core.framework import full_type_pb2
  from tensorflow.core.function import trace_type
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.framework import type_spec
  from tensorflow.python.framework.type_utils import fulltypes_for_flat_tensors
  from tensorflow.python.ops import array_ops
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 11 for calling the TensorSpecTest obj's underlying member method code with example usage: obj.testFromPlaceholder() without return types