# tf.contrib.framework.nest.flatten_dict_items

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/util/nest.py#L329-L382) |

Returns a dictionary with flattened keys and values.

    tf.contrib.framework.nest.flatten_dict_items(
        dictionary
    )

This function flattens the keys and values of a dictionary, which can be
arbitrarily nested structures, and returns the flattened version of such
structures:

    example_dictionary = {(4, 5, (6, 8)): ("a", "b", ("c", "d"))}
    result = {4: "a", 5: "b", 6: "c", 8: "d"}
    flatten_dict_items(example_dictionary) == result

The input dictionary must satisfy two properties:

1. Its keys and values should have the same exact nested structure.
2. The set of all flattened keys of the dictionary must not contain repeated keys.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `dictionary` | the dictionary to zip |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| The zipped dictionary. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | If the input is not a dictionary. |
| `ValueError` | If any key and value do not have the same structure layout, or if keys are not unique. |

<br />