MCPcopy Create free account
hub / github.com/alibaba/graph-learn / BuildInput

Method BuildInput

graphlearn/src/core/runner/dag_node_runner.cc:55–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55bool DagNodeRunner::BuildInput(
56 const DagNode* node, Tape* tape,
57 Tensor::Map* tensors) {
58 for (auto& edge : node->InEdges()) {
59 auto src_node = edge->Src();
60 auto record = tape->Retrieval(src_node->Id());
61 if (record.size() == 0) {
62 LOG(ERROR) << "DagEdge has no src node: " << src_node->Id();
63 return false;
64 }
65
66 auto it = record.find(edge->SrcOutput());
67 if (it == record.end()) {
68 LOG(ERROR) << "Invalid upstream: " << edge->SrcOutput();
69 return false;
70 } else {
71 // Copy tensor instead of move, because one DagNode could have
72 // multiple downstream DagNodes.
73 tensors->emplace(edge->DstInput(), it->second);
74 }
75 }
76 return true;
77}
78
79std::unique_ptr<OpResponse> DagNodeRunner::RunOp(
80 const DagNode* node,

Callers

nothing calls this directly

Calls 5

SrcMethod · 0.80
findMethod · 0.80
IdMethod · 0.45
sizeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected