# tf.experimental.dtensor.check_layout

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.13.1/tensorflow/dtensor/python/api.py#L375-L388) |

Asserts that the layout of the DTensor is `layout`.

    tf.experimental.dtensor.check_layout(
        tensor: https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/Tensor,
        layout: https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/experimental/dtensor/Layout
    ) -> None

<br />

<br />

<br />

| ## Args ||
|---|---|
| `tensor` | A DTensor whose layout is to be checked. |
| `layout` | The `Layout` to compare against. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If the layout of `tensor` does not match the supplied `layout`. |

<br />