Commit 81ae50e5 authored by Bixia Zheng's avatar Bixia Zheng Committed by TensorFlower Gardener
Browse files

[XLA] Fix a bug in the HLO evaluator implementation of the Clamp operation.

Previously, we incorrectly convert integer values to floating point values then
compute the clamped result and convert the result back to the desired type.
This can lead to incorrect result when the value can't be represented by the
floating point type precisely. The fix is to avoid such type conversion.

Add a test case.

PiperOrigin-RevId: 234169980
parent 72a0e076
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment