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, ...).
When unspecified, uses
image_data_format value found in your Keras config file at
~/.keras/keras.json (if exists) else 'channels_last'.
Defaults to 'channels_last'.
[null,null,["Last updated 2024-01-23 UTC."],[],[],null,["# tf.keras.layers.Flatten\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/keras-team/keras/tree/v2.15.0/keras/layers/reshaping/flatten.py#L32-L122) |\n\nFlattens the input. Does not affect the batch size.\n\nInherits From: [`Layer`](../../../tf/keras/layers/Layer), [`Module`](../../../tf/Module) \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| Args ---- ||\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, ...)`. When unspecified, uses `image_data_format` value found in your Keras config file at `~/.keras/keras.json` (if exists) else 'channels_last'. Defaults to '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)"]]