# tfr.utils.ragged_to_dense

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/ranking/blob/v0.5.3/tensorflow_ranking/python/utils.py#L421-L443) |

Converts given inputs from ragged tensors to dense tensors.

    tfr.utils.ragged_to_dense(
        labels, predictions, weights
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `labels` | A [`tf.RaggedTensor`](https://www.tensorflow.org/api_docs/python/tf/RaggedTensor) of the same shape as `predictions` representing relevance. |
| `predictions` | A [`tf.RaggedTensor`](https://www.tensorflow.org/api_docs/python/tf/RaggedTensor) with shape \[batch_size, (list_size)\]. Each value is the ranking score of the corresponding example. |
| `weights` | An optional [`tf.RaggedTensor`](https://www.tensorflow.org/api_docs/python/tf/RaggedTensor) of the same shape of predictions or a [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor) of shape \[batch_size, 1\]. The former case is per-example and the latter case is per-list. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A tuple (labels, predictions, weights, mask) of dense [`tf.Tensor`](https://www.tensorflow.org/api_docs/python/tf/Tensor)s. ||

<br />