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

Method GetFastestInputOutputTimeShape

oneflow/core/graph/task_node.cpp:128–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128std::shared_ptr<Shape> TaskNode::GetFastestInputOutputTimeShape() const {
129 std::shared_ptr<Shape> shape;
130 auto UpdateRetShape = [&](TaskEdge* edge) {
131 for (const auto& regst : edge->GetRegsts()) {
132 if (!shape || shape->elem_cnt() < regst->data_regst_time_shape()->elem_cnt()) {
133 shape = regst->data_regst_time_shape();
134 }
135 }
136 };
137 ForEachOutDataEdge(UpdateRetShape);
138 if (shape) { return shape; }
139 ForEachInDataEdge(UpdateRetShape);
140 return shape;
141}
142
143void TaskNode::ForEachConsumedDataRegst(
144 const std::function<void(const std::string&, const RegstDesc*)>& Handler) const {

Callers 1

Calls 2

GetRegstsMethod · 0.80
elem_cntMethod · 0.45

Tested by

no test coverage detected