Convert some flaky tests to use approx comparisons (#746)

* Convert some flaky tests to use approx comparisons

Closes #741

* Mention approximate runtime in the scripts
This commit is contained in:
Damien Elmes 2023-09-01 23:01:15 +10:00 committed by GitHub
parent 3669d2a6d4
commit 5839806687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 5 deletions

View File

@ -9,7 +9,7 @@ mod tests {
let data_actual = tensor.mean().to_data();
assert_eq!(data_actual, Data::from([15.0 / 6.0]));
data_actual.assert_approx_eq(&Data::from([15.0 / 6.0]), 3);
}
#[test]
@ -45,7 +45,7 @@ mod tests {
let data_actual = tensor.mean_dim(1).to_data();
assert_eq!(data_actual, Data::from([[3.0 / 3.0], [12.0 / 3.0]]));
data_actual.assert_approx_eq(&Data::from([[3.0 / 3.0], [12.0 / 3.0]]), 3);
}
#[test]

View File

@ -14,7 +14,7 @@ mod tests {
let data_actual = output.into_data();
let data_expected = Data::from([[0.0, 1.0, 1.0], [1.0, 1.0, 1.0]]);
assert_eq!(data_expected, data_actual);
data_expected.assert_approx_eq(&data_actual, 3);
}
#[test]

View File

@ -1,4 +1,5 @@
# This script runs all `burn` checks locally
# This script runs all `burn` checks locally. It may take around 15 minutes on
# the first run.
#
# Run `run-checks` using this command:
#

View File

@ -3,7 +3,8 @@
# Exit immediately if a command exits with a non-zero status.
set -e
# This script runs all `burn` checks locally
# This script runs all `burn` checks locally. It may take around 15 minutes
# on the first run.
#
# Run `run-checks` using this command:
#