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
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 .
|