MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / ForEachDataEdge

Function ForEachDataEdge

oneflow/core/graph/task_node.cpp:26–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24namespace {
25
26void ForEachDataEdge(const std::unordered_set<TaskEdge*>& edges,
27 const std::function<void(TaskEdge*)>& Handler) {
28 for (TaskEdge* edge : edges) {
29 const auto& regsts = edge->GetRegsts();
30 int32_t data_regst_size =
31 std::count_if(regsts.begin(), regsts.end(), [](const std::shared_ptr<RegstDesc>& regst) {
32 return regst->regst_desc_type().has_data_regst_desc();
33 });
34 if (data_regst_size == regsts.size()) {
35 Handler(edge);
36 } else {
37 CHECK_EQ(data_regst_size, 0);
38 }
39 }
40}
41
42} // namespace
43

Callers 2

ForEachInDataEdgeMethod · 0.85
ForEachOutDataEdgeMethod · 0.85

Calls 4

GetRegstsMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected