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

[XLA:CPU/GPU] Fix a problem in the random number generator for F16.

ConvertValueForDistribution incorrectly uses the element type to perform the
division that reduces the raw value to the range of [0, 1). When the element
type is F16, the result of a division result is always zero due to overflow
and the generator always generates a value equal to the lower bound of the
requested range. To fix this problem, we perform the division using the float
type with the same number of bits as the raw value type.

PiperOrigin-RevId: 207662942
parent 6bca0c27
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment