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

Method MergeFromGlobal

tensorflow/core/graph/costmodel.cc:77–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void CostModel::MergeFromGlobal(const CostModel& cm) {
78 CHECK(is_global_);
79 CHECK_EQ(true, cm.is_global());
80 const int num_nodes = cm.count_.size();
81 for (int i = num_nodes - 1; i >= 0; --i) {
82 count_[i] += cm.count_[i];
83 time_[i] += cm.time_[i];
84 int num_slots = cm.slot_bytes_[i].size();
85 Ensure(i, num_slots);
86 if (num_slots > 0) {
87 if (slot_bytes_[i].empty()) {
88 slot_bytes_[i].resize(num_slots);
89 } else {
90 CHECK_EQ(num_slots, slot_bytes_[i].size());
91 }
92 for (int s = 0; s < num_slots; ++s) {
93 slot_bytes_[i][s] += cm.slot_bytes_[i][s];
94 }
95 }
96 }
97}
98
99void CostModel::MergeFromStats(const NodeNameToCostIdMap& map,
100 const StepStats& ss) {

Callers

nothing calls this directly

Calls 4

is_globalMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected