fix(loss): Declare all contents of reduction as public (#423)

This commit is contained in:
Yu Sun 2023-06-22 01:00:57 +08:00 committed by GitHub
parent fce45f51be
commit 9c5afa3469
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -4,3 +4,4 @@ mod reduction;
pub use cross_entropy::*;
pub use mse::*;
pub use reduction::*;

View File

@ -2,6 +2,7 @@
mod tests {
use super::*;
use burn_tensor::{Data, Tensor};
use core::f32::consts::SQRT_2;
#[test]
fn should_support_sqrt_ops() {
@ -10,7 +11,7 @@ mod tests {
let data_actual = tensor.sqrt().into_data();
let data_expected = Data::from([[0.0, 1.0, 1.41421], [1.73205, 2.0, 2.2360]]);
let data_expected = Data::from([[0.0, 1.0, SQRT_2], [1.73205, 2.0, 2.2360]]);
data_expected.assert_approx_eq(&data_actual, 3);
}
}