MCPcopy Create free account
hub / github.com/Samsung/ONE / TEST

Function TEST

compiler/circle-eval-diff/src/MetricPrinter.test.cpp:205–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203{
204
205TEST(CircleEvalMetricPrinterTest, MAE_simple)
206{
207 luci::Module first;
208 AddOneGraph first_g;
209 first_g.init();
210
211 first.add(std::move(first_g.graph()));
212
213 luci::Module second;
214 AddTwoGraph second_g;
215 second_g.init();
216
217 second.add(std::move(second_g.graph()));
218
219 MAEPrinter mae;
220
221 mae.init(&first, &second);
222
223 // This test does not actually evaluate the modules, but create
224 // fake results.
225 std::vector<std::shared_ptr<Tensor>> first_result;
226 {
227 auto output = output_tensor_with_value(&first, 1.0);
228 first_result.emplace_back(output);
229 }
230
231 std::vector<std::shared_ptr<Tensor>> second_result;
232 {
233 auto output = output_tensor_with_value(&second, 2.0);
234 second_result.emplace_back(output);
235 }
236
237 mae.accumulate(first_result, second_result);
238
239 std::stringstream ss;
240 mae.dump(ss);
241 std::string result = ss.str();
242
243 EXPECT_NE(std::string::npos, result.find("MAE for output_0 is 1"));
244}
245
246TEST(CircleEvalMetricPrinterTest, MAE_init_with_null_NEG)
247{

Callers

nothing calls this directly

Calls 10

output_tensor_with_valueFunction · 0.85
initMethod · 0.45
addMethod · 0.45
graphMethod · 0.45
emplace_backMethod · 0.45
accumulateMethod · 0.45
dumpMethod · 0.45
strMethod · 0.45
findMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected