tf.compat.v1.layers.Flatten

Arguments:

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, ...).