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

Method SortOpsByTime

tensorflow/python/grappler/cost_analyzer.cc:129–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void CostAnalyzer::SortOpsByTime(std::map<string, OpPerfSummary> ops) {
130 for (const auto& op : ops) {
131 ops_.push_back(op.second);
132 }
133 struct CompareByTime {
134 bool operator()(const OpPerfSummary& a, const OpPerfSummary& b) const {
135 return a.time > b.time;
136 }
137 };
138 std::stable_sort(ops_.begin(), ops_.end(), CompareByTime());
139}
140
141void CostAnalyzer::AnalyzeCosts() {
142 std::map<string, OpPerfSummary> ops;

Callers

nothing calls this directly

Calls 4

CompareByTimeClass · 0.85
push_backMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected