From 60043ea048cc7f19702ba0a9800fe8e6fa68a05c Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+SamuelMarks@users.noreply.github.com> Date: Wed, 12 Apr 2023 20:36:34 -0400 Subject: [PATCH] [keras/layers/pooling/average_pooling2d.py,keras/layers/pooling/average_pooling3d.py,keras/layers/pooling/global_average_pooling2d.py,keras/layers/pooling/global_average_pooling3d.py,keras/layers/pooling/global_max_pooling2d.py,keras/layers/pooling/global_max_pooling3d.py,keras/layers/pooling/max_pooling2d.py,keras/layers/pooling/max_pooling3d.py] Standardise docstring usage of "Default to" --- keras/layers/pooling/average_pooling2d.py | 7 ++++--- keras/layers/pooling/average_pooling3d.py | 7 ++++--- keras/layers/pooling/global_average_pooling2d.py | 6 +++--- keras/layers/pooling/global_average_pooling3d.py | 7 ++++--- keras/layers/pooling/global_max_pooling2d.py | 7 ++++--- keras/layers/pooling/global_max_pooling3d.py | 7 ++++--- keras/layers/pooling/max_pooling2d.py | 7 ++++--- keras/layers/pooling/max_pooling3d.py | 7 ++++--- 8 files changed, 31 insertions(+), 24 deletions(-) diff --git a/keras/layers/pooling/average_pooling2d.py b/keras/layers/pooling/average_pooling2d.py index b818ed7e3a87..662ec99016e6 100644 --- a/keras/layers/pooling/average_pooling2d.py +++ b/keras/layers/pooling/average_pooling2d.py @@ -108,9 +108,10 @@ class AveragePooling2D(Pooling2D): `(batch, height, width, channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, height, width)`. - 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". + 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'. Input shape: - If `data_format='channels_last'`: diff --git a/keras/layers/pooling/average_pooling3d.py b/keras/layers/pooling/average_pooling3d.py index 41faa234aeb0..9d1177e6c68d 100644 --- a/keras/layers/pooling/average_pooling3d.py +++ b/keras/layers/pooling/average_pooling3d.py @@ -48,9 +48,10 @@ class AveragePooling3D(Pooling3D): `(batch, spatial_dim1, spatial_dim2, spatial_dim3, channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3)`. - 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". + 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'. Input shape: - If `data_format='channels_last'`: diff --git a/keras/layers/pooling/global_average_pooling2d.py b/keras/layers/pooling/global_average_pooling2d.py index beb7038122c0..e219e2414081 100644 --- a/keras/layers/pooling/global_average_pooling2d.py +++ b/keras/layers/pooling/global_average_pooling2d.py @@ -44,9 +44,9 @@ class GlobalAveragePooling2D(GlobalPooling2D): `(batch, height, width, channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, height, width)`. - 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". + 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'. keepdims: A boolean, whether to keep the spatial dimensions or not. If `keepdims` is `False` (default), the rank of the tensor is reduced for spatial dimensions. diff --git a/keras/layers/pooling/global_average_pooling3d.py b/keras/layers/pooling/global_average_pooling3d.py index b2819c55164d..04b95667ed8e 100644 --- a/keras/layers/pooling/global_average_pooling3d.py +++ b/keras/layers/pooling/global_average_pooling3d.py @@ -36,9 +36,10 @@ class GlobalAveragePooling3D(GlobalPooling3D): `(batch, spatial_dim1, spatial_dim2, spatial_dim3, channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3)`. - 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". + 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'. keepdims: A boolean, whether to keep the spatial dimensions or not. If `keepdims` is `False` (default), the rank of the tensor is reduced for spatial dimensions. diff --git a/keras/layers/pooling/global_max_pooling2d.py b/keras/layers/pooling/global_max_pooling2d.py index 3ef2ee74a544..77ef11b3abdd 100644 --- a/keras/layers/pooling/global_max_pooling2d.py +++ b/keras/layers/pooling/global_max_pooling2d.py @@ -42,9 +42,10 @@ class GlobalMaxPooling2D(GlobalPooling2D): `(batch, height, width, channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, height, width)`. - 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". + 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'. keepdims: A boolean, whether to keep the spatial dimensions or not. If `keepdims` is `False` (default), the rank of the tensor is reduced for spatial dimensions. diff --git a/keras/layers/pooling/global_max_pooling3d.py b/keras/layers/pooling/global_max_pooling3d.py index ee153d9c3cdd..f5385fc9b414 100644 --- a/keras/layers/pooling/global_max_pooling3d.py +++ b/keras/layers/pooling/global_max_pooling3d.py @@ -34,9 +34,10 @@ class GlobalMaxPooling3D(GlobalPooling3D): `(batch, spatial_dim1, spatial_dim2, spatial_dim3, channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3)`. - 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". + 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'. keepdims: A boolean, whether to keep the spatial dimensions or not. If `keepdims` is `False` (default), the rank of the tensor is reduced for spatial dimensions. diff --git a/keras/layers/pooling/max_pooling2d.py b/keras/layers/pooling/max_pooling2d.py index 7378d3d91a90..f21ab07f2142 100644 --- a/keras/layers/pooling/max_pooling2d.py +++ b/keras/layers/pooling/max_pooling2d.py @@ -127,9 +127,10 @@ class MaxPooling2D(Pooling2D): `(batch, height, width, channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, height, width)`. - 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". + 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'. Input shape: - If `data_format='channels_last'`: diff --git a/keras/layers/pooling/max_pooling3d.py b/keras/layers/pooling/max_pooling3d.py index b0455dbf4d4e..64b2575732eb 100644 --- a/keras/layers/pooling/max_pooling3d.py +++ b/keras/layers/pooling/max_pooling3d.py @@ -48,9 +48,10 @@ class MaxPooling3D(Pooling3D): `(batch, spatial_dim1, spatial_dim2, spatial_dim3, channels)` while `channels_first` corresponds to inputs with shape `(batch, channels, spatial_dim1, spatial_dim2, spatial_dim3)`. - 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". + 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'. Input shape: - If `data_format='channels_last'`: