Watch talks from the 2019 TensorFlow Dev Summit Watch now

tf.data.experimental.SparseTensorStructure

Class SparseTensorStructure

Inherits From: Structure

Defined in tensorflow/python/data/util/structure.py.

Represents structural information about a tf.SparseTensor.

__init__

__init__(
    dtype,
    dense_shape
)

Initialize self. See help(type(self)) for accurate signature.

Methods

from_value

@staticmethod
from_value(value)

Returns a Structure that represents the given value.

Args:

  • value: A potentially structured value.

Returns:

A Structure that is compatible with value.

Raises:

  • TypeError: If a structure cannot be built for value, because its type or one of its component types is not supported.

is_compatible_with

is_compatible_with(other)

Returns True if other is compatible with this structure.

A structure t is a "subtype" of s if:

Args:

  • other: A Structure.

Returns:

True if other is a subtype of this structure, otherwise False.