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

Method ColumnString

tensorflow/core/util/stats_calculator.cc:68–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68std::string StatsCalculator::ColumnString(const Detail& detail,
69 const int64_t cumulative_stat_on_node,
70 const Stat<int64_t>& stat) const {
71 const double start_ms = detail.start_us.avg() / 1000.0;
72 const double first_time_ms = detail.rel_end_us.first() / 1000.0;
73 const double avg_time_ms = detail.rel_end_us.avg() / 1000.0;
74 const double percentage = detail.rel_end_us.sum() * 100.0 / stat.sum();
75 const double cdf_percentage = (cumulative_stat_on_node * 100.0f) / stat.sum();
76 const int64_t times_called = detail.times_called / num_runs();
77
78 std::stringstream stream;
79 InitField(stream, 24) << detail.type;
80 InitField(stream, 17) << start_ms;
81 InitField(stream, 9) << first_time_ms;
82 InitField(stream, 9) << avg_time_ms;
83 InitField(stream, 7) << percentage << "%";
84 InitField(stream, 7) << cdf_percentage << "%";
85 InitField(stream, 10) << detail.mem_used.newest() / 1000.0;
86 InitField(stream, 9) << times_called;
87 stream << "\t" << detail.name;
88
89 return stream.str();
90}
91
92void StatsCalculator::OrderNodesByMetric(
93 SortingMetric metric, std::vector<const Detail*>* details) const {

Callers 1

QueryStringMethod · 0.45

Calls 4

avgMethod · 0.80
newestMethod · 0.80
firstMethod · 0.45
sumMethod · 0.45

Tested by 1

QueryStringMethod · 0.36