class_docstr: Describes a tf.Tensor.
  
  Metadata for describing the `tf.Tensor` objects accepted or returned
  by some TensorFlow APIs.
code: def from_tensor(cls, tensor, name=None):
      if isinstance(tensor, ops.EagerTensor):
          return TensorSpec(tensor.shape, tensor.dtype, name)
      elif isinstance(tensor, ops.Tensor):
          return TensorSpec(
              tensor.shape, tensor.dtype, name or tensor.op.name
          )
      else:
          raise ValueError("`tensor` should be a tf.Tensor")
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensorflow.python.framework import common_shapes
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
label_desc: Use image node_id 3 for calling the TensorSpec obj's underlying member method code with example usage: obj.from_tensor(cls, tensor, name) and returns: TensorSpec, TensorSpec