tf.dtypes.DType

View source on GitHub

Represents the type of the elements in a Tensor.

tf.dtypes.DType(
    type_enum
)

The following DType objects are defined:

The tf.as_dtype() function converts numpy types and string type names to a DType object.

Args:

Attributes:

Raises:

Methods

__eq__

View source

__eq__(
    other
)

Returns True iff this DType refers to the same type as other.

__ne__

View source

__ne__(
    other
)

Returns True iff self != other.

is_compatible_with

View source

is_compatible_with(
    other
)

Returns True if the other DType will be converted to this DType.

The conversion rules are as follows:

DType(T)       .is_compatible_with(DType(T))        == True

Args:

Returns:

True if a Tensor of the other DType will be implicitly converted to this DType.