From 7e13898d5019084d7649f542edc42d0afb42760d Mon Sep 17 00:00:00 2001 From: Tommy van der Vorst Date: Sat, 25 Mar 2023 19:07:24 +0100 Subject: [PATCH] chore: formatting --- wonnx/tests/localresponsenormalization.rs | 33 ++++++++++++++--------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/wonnx/tests/localresponsenormalization.rs b/wonnx/tests/localresponsenormalization.rs index c52aff6c..8f4202fa 100644 --- a/wonnx/tests/localresponsenormalization.rs +++ b/wonnx/tests/localresponsenormalization.rs @@ -9,7 +9,11 @@ fn local_response_normalization() { let batches = 1; let width_height: usize = 3; let channels: usize = 4; - let data: Vec = [ 1.,1.,2.,4., 2.,2.,1.,2., 3.,1.,2.,1., 4.,2.,3.,5., 3.,3.,2.,2., 6.,2.,3.,1., 7.,3.,4.,2., 8.,4.,3.,2., 9.,3.,4.,4.].to_vec(); + let data: Vec = [ + 1., 1., 2., 4., 2., 2., 1., 2., 3., 1., 2., 1., 4., 2., 3., 5., 3., 3., 2., 2., 6., 2., 3., + 1., 7., 3., 4., 2., 8., 4., 3., 2., 9., 3., 4., 4., + ] + .to_vec(); let shape = vec![ batches as i64, @@ -20,21 +24,22 @@ fn local_response_normalization() { input_data.insert("X".to_string(), data.as_slice().into()); let bn_model = model(graph( - vec![tensor("X", &shape)], // input - vec![tensor("Y", &shape)], // output - vec![], // infos - vec![], // intializers - + vec![tensor("X", &shape)], // input + vec![tensor("Y", &shape)], // output + vec![], // infos + vec![], // intializers // nodes vec![node( vec!["X"], vec!["Y"], "lrn", "LRN", - vec![ attribute("alpha", 1.0), - attribute("beta", 1.0), - attribute("bias", 0.0), - attribute("size", 2)], + vec![ + attribute("alpha", 1.0), + attribute("beta", 1.0), + attribute("bias", 0.0), + attribute("size", 2), + ], )], )); @@ -47,6 +52,10 @@ fn local_response_normalization() { common::assert_eq_vector( out_y.try_into().unwrap(), - &[1.0, 0.4, 0.2, 0.5, 0.5, 0.8, 0.4, 1.0, 0.6, 0.4, 0.8, 2.0, 0.4, 0.30769232, 0.1764706, 0.39999998, 0.33333334, 0.4615385, 0.5, 1.0, 0.3, 0.30769232, 0.6, 2.0, 0.2413793, 0.24, 0.4, 1.0, 0.2, 0.32, 0.4615385, 1.0, 0.2, 0.24, 0.25, 0.5], + &[ + 1.0, 0.4, 0.2, 0.5, 0.5, 0.8, 0.4, 1.0, 0.6, 0.4, 0.8, 2.0, 0.4, 0.30769232, 0.1764706, + 0.39999998, 0.33333334, 0.4615385, 0.5, 1.0, 0.3, 0.30769232, 0.6, 2.0, 0.2413793, + 0.24, 0.4, 1.0, 0.2, 0.32, 0.4615385, 1.0, 0.2, 0.24, 0.25, 0.5, + ], ); -} \ No newline at end of file +}