Skip to content

Commit 0cfd2aa

Browse files
authored
Use tf.int32.min rather than relying on integer overflow (#21077)
1 parent 168f253 commit 0cfd2aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

keras/src/backend/tensorflow/numpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,7 @@ def signbit(x):
20782078
tf.bitwise.bitwise_and(
20792079
tf.bitcast(x, tf.int32),
20802080
# tf.float32 sign bit
2081-
tf.constant(0x80000000, dtype=tf.int32),
2081+
tf.constant(tf.int32.min, dtype=tf.int32),
20822082
),
20832083
0,
20842084
)

0 commit comments

Comments
 (0)