Skip to content

Commit

Permalink
raise exception on unknown padding for conv (#19057)
Browse files Browse the repository at this point in the history
  • Loading branch information
anas-rz authored Jan 15, 2024
1 parent 9c42023 commit 23d5eeb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions keras/ops/operation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ def compute_conv_output_shape(
)
elif padding == "same" or padding == "causal":
output_spatial_shape = np.floor((spatial_shape - 1) / strides) + 1
else:
raise ValueError(
"`padding` must be either `'valid'` or `'same'`. Received "
f"{padding}."
)
output_spatial_shape = [int(i) for i in output_spatial_shape]
for i in none_dims:
output_spatial_shape[i] = None
Expand Down

0 comments on commit 23d5eeb

Please sign in to comment.