# tf_agents.distributions.utils.assert_specs_are_compatible

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/distributions/utils.py#L634-L672) |

Checks that the output of [`network.create_variables`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/networks/network/create_variables) matches a spec.

    tf_agents.distributions.utils.assert_specs_are_compatible(
        network_output_spec: https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/NestedTensorSpec,
        spec: https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/NestedTensorSpec,
        message_prefix: str
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `network_output_spec` | The output of [`network.create_variables`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/networks/network/create_variables). |
| `spec` | The spec we are matching to. |
| `message_prefix` | The message prefix for error messages, used when the specs don't match. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If the specs don't match. |

<br />