Skip to content

Commit

Permalink
Merge pull request keras-team#17966 from SamuelMarks:keras.layers.poo…
Browse files Browse the repository at this point in the history
…ling-defaults-to

PiperOrigin-RevId: 536554754
  • Loading branch information
tensorflower-gardener committed May 31, 2023
2 parents 304bb3d + 60043ea commit cf88ada
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 24 deletions.
7 changes: 4 additions & 3 deletions keras/layers/pooling/average_pooling2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'`:
Expand Down
7 changes: 4 additions & 3 deletions keras/layers/pooling/average_pooling3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'`:
Expand Down
6 changes: 3 additions & 3 deletions keras/layers/pooling/global_average_pooling2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions keras/layers/pooling/global_average_pooling3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions keras/layers/pooling/global_max_pooling2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions keras/layers/pooling/global_max_pooling3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions keras/layers/pooling/max_pooling2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'`:
Expand Down
7 changes: 4 additions & 3 deletions keras/layers/pooling/max_pooling3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'`:
Expand Down

0 comments on commit cf88ada

Please sign in to comment.