# tff.structure.is_same_structure

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/federated/blob/v0.87.0 Version 2.0, January 2004 Licensed under the Apache License, Version 2.0 (the) |

Compares whether `a` and `b` have the same nested structure.

    tff.structure.is_same_structure(
        a: https://www.tensorflow.org/federated/api_docs/python/tff/structure/Struct,
        b: https://www.tensorflow.org/federated/api_docs/python/tff/structure/Struct
    ) -> bool

This method is analogous to [`tf.nest.assert_same_structure`](https://www.tensorflow.org/api_docs/python/tf/nest/assert_same_structure),
but returns a boolean rather than throwing an exception.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `a` | a `Struct` object. |
| `b` | a `Struct` object. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| True iff `a` and `b` have the same nested structure. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | if `a` or `b` are not of type `Struct`. |

<br />