A string,
one of channels_last (default) or channels_first.
The ordering of the dimensions in the inputs.
channels_last corresponds to inputs with shape
(batch, ..., channels) while channels_first corresponds to
inputs with shape (batch, channels, ...).
It defaults to the image_data_format value found in your
Keras config file at ~/.keras/keras.json.
If you never set it, then it will be "channels_last".
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.keras.layers.Flatten\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/keras/layers/Flatten) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.3.0/tensorflow/python/keras/layers/core.py#L612-L696) |\n\nFlattens the input. Does not affect the batch size.\n\nInherits From: [`Layer`](../../../tf/keras/layers/Layer)\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.keras.layers.Flatten`](/api_docs/python/tf/keras/layers/Flatten)\n\n\u003cbr /\u003e\n\n tf.keras.layers.Flatten(\n data_format=None, **kwargs\n )\n\n| **Note:** If inputs are shaped `(batch,)` without a feature axis, then flattening adds an extra channel dimension and output shape is `(batch, 1)`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Arguments --------- ||\n|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `data_format` | A string, one of `channels_last` (default) or `channels_first`. The ordering of the dimensions in the inputs. `channels_last` corresponds to inputs with shape `(batch, ..., channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, ...)`. It defaults to the `image_data_format` value found in your Keras config file at `~/.keras/keras.json`. If you never set it, then it will be \"channels_last\". |\n\n\u003cbr /\u003e\n\n#### Example:\n\n model = tf.keras.Sequential()\n model.add(tf.keras.layers.Conv2D(64, 3, 3, input_shape=(3, 32, 32)))\n model.output_shape\n (None, 1, 10, 64)\n\n model.add(Flatten())\n model.output_shape\n (None, 640)"]]