Change assert_approx_eq precision from 3 to 2 (#1491)

This commit is contained in:
Guillaume Lagrange 2024-03-19 12:26:21 -04:00 committed by GitHub
parent 69f1877754
commit 430f642394
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 7 deletions

View File

@ -124,7 +124,7 @@ mod reduction {
)); ));
let val_ref = tensor_ref.sum_dim(reduce_dim); let val_ref = tensor_ref.sum_dim(reduce_dim);
val_ref.into_data().assert_approx_eq(&val.into_data(), 3); val_ref.into_data().assert_approx_eq(&val.into_data(), 2);
} }
#[test] #[test]
@ -142,7 +142,7 @@ mod reduction {
)); ));
let val_ref = tensor_ref.sum_dim(reduce_dim); let val_ref = tensor_ref.sum_dim(reduce_dim);
val_ref.into_data().assert_approx_eq(&val.into_data(), 3); val_ref.into_data().assert_approx_eq(&val.into_data(), 2);
} }
#[test] #[test]
@ -160,7 +160,7 @@ mod reduction {
)); ));
let val_ref = tensor_ref.sum_dim(reduce_dim); let val_ref = tensor_ref.sum_dim(reduce_dim);
val_ref.into_data().assert_approx_eq(&val.into_data(), 3); val_ref.into_data().assert_approx_eq(&val.into_data(), 2);
} }
#[test] #[test]
@ -181,7 +181,7 @@ mod reduction {
)); ));
let val_ref = tensor_ref.sum_dim(reduce_dim); let val_ref = tensor_ref.sum_dim(reduce_dim);
val_ref.into_data().assert_approx_eq(&val.into_data(), 3); val_ref.into_data().assert_approx_eq(&val.into_data(), 2);
} }
#[test] #[test]
@ -199,7 +199,7 @@ mod reduction {
)); ));
let val_ref = tensor_ref.mean_dim(reduce_dim); let val_ref = tensor_ref.mean_dim(reduce_dim);
val_ref.into_data().assert_approx_eq(&val.into_data(), 3); val_ref.into_data().assert_approx_eq(&val.into_data(), 2);
} }
#[test] #[test]
@ -254,7 +254,7 @@ mod reduction {
)); ));
let val_ref = tensor_ref.sum(); let val_ref = tensor_ref.sum();
val_ref.into_data().assert_approx_eq(&val.into_data(), 3); val_ref.into_data().assert_approx_eq(&val.into_data(), 2);
} }
#[test] #[test]
@ -270,7 +270,7 @@ mod reduction {
)); ));
let val_ref = tensor_ref.prod(); let val_ref = tensor_ref.prod();
val_ref.into_data().assert_approx_eq(&val.into_data(), 3); val_ref.into_data().assert_approx_eq(&val.into_data(), 2);
} }
#[test] #[test]