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, ...).
Examples:
x=tf.compat.v1.placeholder(shape=(None,4,4),dtype='float32')y=Flatten()(x)# now `y` has shape `(None, 16)`x=tf.compat.v1.placeholder(shape=(None,3,None),dtype='float32')y=Flatten()(x)# now `y` has shape `(None, None)`
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.layers.Flatten\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/layers/core.py#L275-L297) |\n\nFlattens an input tensor while preserving the batch axis (axis 0).\n\nInherits From: [`Flatten`](../../tf/keras/layers/Flatten), [`Layer`](../../tf/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.layers.Flatten`](/api_docs/python/tf/compat/v1/layers/Flatten)\n\n\u003cbr /\u003e\n\n tf.layers.Flatten(\n data_format=None, **kwargs\n )\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, ...)`. |\n\n\u003cbr /\u003e\n\n#### Examples:\n\n x = tf.compat.v1.placeholder(shape=(None, 4, 4), dtype='float32')\n y = Flatten()(x)\n # now `y` has shape `(None, 16)`\n\n x = tf.compat.v1.placeholder(shape=(None, 3, None), dtype='float32')\n y = Flatten()(x)\n # now `y` has shape `(None, None)`\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `graph` | DEPRECATED FUNCTION \u003cbr /\u003e | **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Stop using this property because tf.layers layers no longer track their graph. |\n| `scope_name` | \u003cbr /\u003e |\n\n\u003cbr /\u003e"]]