MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/core/util/stats_calculator_test.cc:24–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22using Detail = StatsCalculator::Detail;
23
24TEST(StatsCalculatorTest, TotalTimeMs) {
25 auto options = StatSummarizerOptions();
26 StatsCalculator calc(options);
27
28 EXPECT_EQ(0, calc.num_runs());
29 calc.UpdateRunTotalUs(1);
30
31 EXPECT_EQ(1, calc.num_runs());
32 calc.UpdateRunTotalUs(2);
33
34 EXPECT_EQ(2, calc.num_runs());
35 auto run_time_us = calc.run_total_us();
36 EXPECT_EQ(1, run_time_us.min());
37 EXPECT_FLOAT_EQ(1.5, run_time_us.avg());
38}
39
40TEST(StatsCalculatorTest, AddNodeStatsUpdate) {
41 auto options = StatSummarizerOptions();

Callers

nothing calls this directly

Calls 10

UpdateRunTotalUsMethod · 0.80
avgMethod · 0.80
AddNodeStatsMethod · 0.80
num_runsMethod · 0.45
minMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
atMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected