Skip to content

Commit cb7e955

Browse files
Update keras/src/backend/tensorflow/image.py
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent cd93668 commit cb7e955

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

keras/src/backend/tensorflow/image.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,8 +711,9 @@ def process_coordinates(coords, size):
711711

712712
if fill_mode == "constant":
713713
all_valid = tf.reduce_all(validities, axis=0)
714-
fill_value_typed = tf.cast(fill_value, weights[0].dtype)
715-
gathered = tf.where(all_valid, gathered, fill_value_typed)
714+
dtype = weights[0].dtype
715+
fill_value_typed = tf.cast(fill_value, dtype)
716+
gathered = tf.where(all_valid, gathered, fill_value_typed)
716717

717718
outputs.append(functools.reduce(operator.mul, weights) * gathered)
718719

0 commit comments

Comments
 (0)