tf.compat.v1.layers.Flatten
Расплющивает тензор входных данных, сохраняя ось пакетной обработки (ось 0).
Наследуется от: Flatten, Layer
tf.compat.v1.layers.Flatten(
data_format=None, **kwargs
)
| Аргументы | |
|---|---|
data_format | Строка, одна из channels_last (по умолчанию) или channels_first. Порядок измерений во входных данных. channels_last соответствует входным данным с формой (batch, ..., channels), в то время как channels_first соответствует входным данным с формой (batch, channels, ...). |
Примеры:
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)`
| Атрибуты | |
|---|---|
graph | УСТАРЕВШАЯ ФУНКЦИЯ |
scope_name | |
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/compat/v1/layers/Flatten