# tff.structure.flatten

<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 a list of values in a possibly recursively nested `Struct`.

    tff.structure.flatten(
        struct: object
    ) -> list[object]

> [!NOTE]
> **Note:** _This implementation is not compatible with the approach of [`tf.nest.flatten`](https://www.tensorflow.org/api_docs/python/tf/nest/flatten), which enforces lexical order for `collections.OrderedDict`s.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `struct` | A `Struct`, possibly recursively nested, or a non-`Struct` element that can be packed with [`tf.nest.flatten`](https://www.tensorflow.org/api_docs/python/tf/nest/flatten). If `struct` has non-`Struct`-typed fields which should be flattened further, they should not contain inner `Structs`, as these will not be flattened (e.g. `Struct([('a', collections.OrderedDict(b=Struct([('c', 5)])))])` would not be valid). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| The list of leaf values in the `Struct`. ||

<br />