Modify CorrCoef test to not rely on floating poing representation of 1/3

The operation computed an average while using the dimension of size 3. This is then changed to multiplying by 1/3 with compilers, but 1/3 cannot be represented perfectly. That made this test case rely on a very precise result from an unrepresentable calculation.

PiperOrigin-RevId: 476391389
This commit is contained in:
Tres Popp 2022-09-23 09:34:12 -07:00 committed by jax authors
parent 38fb8ed22f
commit 0c085471c7

View File

@ -5518,7 +5518,7 @@ class LaxBackedNumpyTests(jtu.JaxTestCase):
{"testcase_name": "_shape={}_dtype={}_rowvar={}".format(
shape, dtype.__name__, rowvar),
"shape": shape, "dtype": dtype, "rowvar": rowvar}
for shape in [(5,), (10, 5), (3, 10)]
for shape in [(5,), (10, 5), (4, 10)]
for dtype in number_dtypes
for rowvar in [True, False]))
def testCorrCoef(self, shape, dtype, rowvar):