View source on GitHub |
Converts a sparse tensor into a dense tensor and returns it.
tf.keras.backend.to_dense(
tensor
)
tensor
: A tensor instance (potentially sparse).A dense tensor.
>>> b = tf.keras.backend.placeholder((2, 2), sparse=True)
>>> print(tf.keras.backend.is_sparse(b))
True
>>> c = tf.keras.backend.to_dense(b)
>>> print(tf.keras.backend.is_sparse(c))
False