# tf_agents.utils.common.check_matching_networks

<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/utils/common.py#L1342-L1371) |

Check that two networks have matching input specs and variables.

    tf_agents.utils.common.check_matching_networks(
        network_1, network_2
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `network_1` | A network.Network. |
| `network_2` | A network.Network. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | if the networks differ in input_spec, variables (number, dtype, or shape). |
| `ValueError` | if either of the networks has not been built yet (e.g. user must call `create_variables`). |

<br />