# tf.keras.backend.to_dense

<br />

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 1 version](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/backend/to_dense) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.1.0/tensorflow/python/keras/backend.py#L718-L742) |

Converts a sparse tensor into a dense tensor and returns it.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.keras.backend.to_dense`](https://www.tensorflow.org/api_docs/python/tf/keras/backend/to_dense)

<br />

    tf.keras.backend.to_dense(
        tensor
    )

<br />

<br />

<br />

| ## Arguments ||
|---|---|
| `tensor` | A tensor instance (potentially sparse). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A dense tensor. ||

<br />

#### Examples:

    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