tft.sparse_tensor_to_dense_with_shape

tft.sparse_tensor_to_dense_with_shape(
    x,
    shape
)

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

Args:

  • x: A SparseTensor.
  • shape: The desired shape of the densified Tensor.

Returns:

A Tensor with the desired shape.

Raises:

  • ValueError: If input is not a SparseTensor.