mirror of https://github.com/tracel-ai/burn.git
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:
parent
3669d2a6d4
commit
5839806687
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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:
|
||||
#
|
||||
|
|
|
@ -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:
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue