tf.TensorSpec

View source on GitHub

Describes a tf.Tensor.

tf.TensorSpec(
    shape, dtype=tf.dtypes.float32, name=None
)

Metadata for describing the tf.Tensor objects accepted or returned by some TensorFlow APIs.

Args:

Attributes:

Raises:

Methods

__eq__

View source

__eq__(
    other
)

Return self==value.

__ne__

View source

__ne__(
    other
)

Return self!=value.

from_spec

View source

@classmethod
from_spec(
    spec, name=None
)

from_tensor

View source

@classmethod
from_tensor(
    tensor, name=None
)

is_compatible_with

View source

is_compatible_with(
    spec_or_tensor
)

Returns True if spec_or_tensor is compatible with this TensorSpec.

Two tensors are considered compatible if they have the same dtype and their shapes are compatible (see tf.TensorShape.is_compatible_with).

Args:

Returns:

True if spec_or_tensor is compatible with self.

most_specific_compatible_type

View source

most_specific_compatible_type(
    other
)

Returns the most specific TypeSpec compatible with self and other.

Args:

Raises: