Skip to content

Commit 02448f6

Browse files
This change proactively relaxes floating point comparisons in unit tests to avoid breaking them when updating the Eigen library in cl/747497592.
Background: The Eigen update contains a number of improvements to the use of fused-multiply-and-add instructions for both float, bfloat16, and float16, as well as changes that may alter summation order in matrix multiplication. While such changes only cause minor numerical changes locally (relative changes on the order of 2^-23, 2^-10, 2^-7, for float, float16, and bfloat16, respectively), such changes may cause sensitive ("ill-conditioned") computations to deviate more significantly, as those small changes propagate. PiperOrigin-RevId: 748177632
1 parent 5ce6c24 commit 02448f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tf_keras/layers/rnn/time_distributed_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def test_TimeDistributed_with_ragged_input(self, layer):
417417
output_dense = model_2.predict(dense_data, steps=1)
418418

419419
output_ragged = convert_ragged_tensor_value(output_ragged)
420-
self.assertAllEqual(output_ragged.to_tensor(), output_dense)
420+
self.assertAllClose(output_ragged.to_tensor(), output_dense)
421421

422422
@test_combinations.run_all_keras_modes
423423
def test_TimeDistributed_with_ragged_input_with_batch_size(self):

0 commit comments

Comments
 (0)