# tff.structure.iter_elements

<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) |

Returns an iterator over (name, value) pairs from a `Struct`.

    tff.structure.iter_elements(
        struct: Struct[_T]
    ) -> Iterator[tuple[Optional[str], _T]]

Modeled as a module function rather than a method of `Struct` to avoid
naming conflicts with the tuple attributes, and so as not to expose the user
to this implementation-oriented functionality.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `struct` | An instance of `Struct`. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| An iterator of 2-tuples of name, value pairs, representing the elements of `struct`. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | if the argument is not an `Struct`. |

<br />