Skip to content

Commit

Permalink
Fix additional shape comparison for TF1 compatibility (#20422)
Browse files Browse the repository at this point in the history
I missed this in #20413. Confirmed this fixes the issue in Colab.
  • Loading branch information
jeffcarp authored Oct 28, 2024
1 parent 533ea63 commit 4ba7d6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion keras/src/backend/tensorflow/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def add(x1, x2):
# Special case of `tf.add`: `tf.nn.bias_add`
# `BiasAdd` can be fused with `MatMul` and `Conv*` kernels
# Expecting `x1` to be `inputs` and `x2` to be `bias` (no swapping)
x2_squeeze_shape = [d for d in x2.shape if d is None or d > 1]
x2_squeeze_shape = [d for d in x2.shape.as_list() if d is None or d > 1]
if (
# `x2` looks like bias (can be squeezed to vector)
1 == len(x2_squeeze_shape)
Expand Down

0 comments on commit 4ba7d6f

Please sign in to comment.