Skip to content

Commit 637c00d

Browse files
author
jballe
committed
Replaces clip followed by cast with saturate_cast.
PiperOrigin-RevId: 243142517
1 parent 3aee283 commit 637c00d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

examples/bls2017.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ def load_image(filename):
4848

4949

5050
def quantize_image(image):
51-
image = tf.clip_by_value(image, 0, 1)
5251
image = tf.round(image * 255)
53-
image = tf.cast(image, tf.uint8)
52+
image = tf.saturate_cast(image, tf.uint8)
5453
return image
5554

5655

0 commit comments

Comments
 (0)