Class SparseTensorSpec
tf.SparseTensorType specification for a .
Aliases:
- Class
tf.compat.v1.SparseTensorSpec
- Class
tf.compat.v2.SparseTensorSpec
init
__init__(
shape=None,
dtype=tf.dtypes.float32
)
tf.SparseTensorConstructs a type specification for a .
Args:
shape
: The denseshape
of theSparseTensor
, orNone
to allow any denseshape
.dtype
:tf.DType
of values in theSparseTensor
.
Properties
dtype
tf.dtypes.DTypeThe specified by this type for the SparseTensor.
shape
tf.TensorShapeThe specified by this type for the SparseTensor.
value_type
Methods
eq
__eq__(other)
Return self==value.
ne
__ne__(other)
Return self!=value.
from_value
@classmethod
from_value(
cls,
value
)
is_compatible_with
is_compatible_with(spec_or_value)
Returns true if spec_or_value
is compatible with this TypeSpec.
most_specific_compatible_type
most_specific_compatible_type(other)
Returns the most specific TypeSpec compatible with self
and other
.
Args:
other
: ATypeSpec
.
Raises:
ValueError
: If there is no TypeSpec that is compatible with bothself
andother
.