View source on GitHub |
Converts dense Tensor
to SparseTensor
, dropping ignore_value
cells.
tfp.math.dense_to_sparse(
x, ignore_value=None, name=None
)
Returns | |
---|---|
sparse_x
|
A tf.SparseTensor with the same shape as x .
|
Raises | |
---|---|
ValueError
|
when x 's rank is None .
|