# Module: tf.nest

<br />

|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 1 version](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/nest) |

Public API for tf.nest namespace.

## Functions

[`assert_same_structure(...)`](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/nest/assert_same_structure): Asserts that two structures are nested in the same way.

[`flatten(...)`](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/nest/flatten): Returns a flat list from a given nested structure.

[`is_nested(...)`](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/nest/is_nested): Returns true if its input is a collections.abc.Sequence (except strings).

[`map_structure(...)`](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/nest/map_structure): Applies `func` to each entry in `structure` and returns a new structure.

[`pack_sequence_as(...)`](https://www.tensorflow.org/versions/r2.0/api_docs/python/tf/nest/pack_sequence_as): Returns a given flattened sequence packed into a given structure.