@@ -115,6 +115,8 @@ def _test_add_ethos_BI_pipeline(
115115 .to_executorch ()
116116 .serialize ()
117117 )
118+ if common .is_option_enabled ("corstone300" ):
119+ tester .run_method_and_compare_outputs (qtol = 1 , inputs = test_data )
118120
119121 return tester
120122
@@ -131,28 +133,20 @@ def test_add_tosa_BI(self, test_data: torch.Tensor):
131133 @parameterized .expand (Add .test_parameters )
132134 def test_add_u55_BI (self , test_data : torch .Tensor ):
133135 test_data = (test_data ,)
134- tester = self ._test_add_ethos_BI_pipeline (
136+ self ._test_add_ethos_BI_pipeline (
135137 self .Add (),
136138 common .get_u55_compile_spec (permute_memory_to_nhwc = True ),
137139 test_data ,
138140 )
139- if common .is_option_enabled ("corstone300" ):
140- tester .run_method_and_compare_outputs (
141- qtol = 1 , inputs = test_data , target_board = "corstone-300"
142- )
143141
144142 @parameterized .expand (Add .test_parameters )
145143 def test_add_u85_BI (self , test_data : torch .Tensor ):
146144 test_data = (test_data ,)
147- tester = self ._test_add_ethos_BI_pipeline (
145+ self ._test_add_ethos_BI_pipeline (
148146 self .Add (),
149147 common .get_u85_compile_spec (permute_memory_to_nhwc = True ),
150148 test_data ,
151149 )
152- if common .is_option_enabled ("corstone300" ):
153- tester .run_method_and_compare_outputs (
154- qtol = 1 , inputs = test_data , target_board = "corstone-320"
155- )
156150
157151 @parameterized .expand (Add2 .test_parameters )
158152 def test_add2_tosa_MI (self , operand1 : torch .Tensor , operand2 : torch .Tensor ):
@@ -167,21 +161,13 @@ def test_add2_tosa_BI(self, operand1: torch.Tensor, operand2: torch.Tensor):
167161 @parameterized .expand (Add2 .test_parameters )
168162 def test_add2_u55_BI (self , operand1 : torch .Tensor , operand2 : torch .Tensor ):
169163 test_data = (operand1 , operand2 )
170- tester = self ._test_add_ethos_BI_pipeline (
164+ self ._test_add_ethos_BI_pipeline (
171165 self .Add2 (), common .get_u55_compile_spec (), test_data
172166 )
173- if common .is_option_enabled ("corstone300" ):
174- tester .run_method_and_compare_outputs (
175- qtol = 1 , inputs = test_data , target_board = "corstone-300"
176- )
177167
178168 @parameterized .expand (Add2 .test_parameters )
179169 def test_add2_u85_BI (self , operand1 : torch .Tensor , operand2 : torch .Tensor ):
180170 test_data = (operand1 , operand2 )
181- tester = self ._test_add_ethos_BI_pipeline (
171+ self ._test_add_ethos_BI_pipeline (
182172 self .Add2 (), common .get_u85_compile_spec (), test_data
183173 )
184- if common .is_option_enabled ("corstone300" ):
185- tester .run_method_and_compare_outputs (
186- qtol = 1 , inputs = test_data , target_board = "corstone-320"
187- )
0 commit comments