Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion keras/src/ops/operation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ def compute_pooling_output_shape(
"""
strides = pool_size if strides is None else strides
input_shape_origin = list(input_shape)
input_shape = np.array(input_shape)
if data_format == "channels_last":
spatial_shape = input_shape[1:-1]
else:
Expand All @@ -129,6 +128,8 @@ def compute_pooling_output_shape(
spatial_shape[i] = -1
none_dims.append(i)
pool_size = np.array(pool_size)
spatial_shape = np.array(spatial_shape)
strides = np.array(strides)
if padding == "valid":
output_spatial_shape = (
np.floor((spatial_shape - pool_size) / strides) + 1
Expand Down