tft.sparse_tensor_to_dense_with_shape  |  TFX  |  TensorFlow (original) (raw)

tft.sparse_tensor_to_dense_with_shape

Stay organized with collections Save and categorize content based on your preferences.

Converts a SparseTensor into a dense tensor and sets its shape.

tft.sparse_tensor_to_dense_with_shape(
    x: tf.SparseTensor,
    shape: Union[tf.TensorShape, Iterable[int]],
    default_value: Union[tf.Tensor, int, float, str] = 0
) -> tf.Tensor

Used in the notebooks

Used in the tutorials
Recommending Movies: Recommender Models in TFX
Args
x A SparseTensor.
shape The desired shape of the densified Tensor.
default_value (Optional) Value to set for indices not specified. Defaults to zero.
Returns
A Tensor with the desired shape.
Raises
ValueError If input is not a SparseTensor.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-11-01 UTC.