MCPcopy Create free account
hub / github.com/alibaba/euler / GetPreNode

Method GetPreNode

euler/parser/translator.cc:146–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146std::shared_ptr<NodeDef> Translator::GetPreNode(
147 const DAGDef& dag_def,
148 const TreeNode& api_node,
149 const std::unordered_map<std::string, int32_t>& as_table,
150 int32_t default_pre_node_id) {
151 TreeNode* search_with_select_node = nullptr;
152 if (IsSelectPreNode(api_node, &search_with_select_node)) {
153 std::string key = search_with_select_node->GetChildren()[0]->
154 GetProp()->GetValues()[0];
155 if (as_table.find(key) == as_table.end()) {
156 EULER_LOG(FATAL) << "node: " << api_node.GetType() << " select error";
157 }
158 return dag_def.GetNodeById(as_table.at(key));
159 } else {
160 return dag_def.GetNodeById(default_pre_node_id);
161 }
162}
163
164void Translator::AddAsNode(
165 NodeDef* node_def, DAGDef* dag_def,

Callers

nothing calls this directly

Calls 8

IsSelectPreNodeFunction · 0.85
GetValuesMethod · 0.80
GetPropMethod · 0.80
GetChildrenMethod · 0.80
findMethod · 0.80
GetNodeByIdMethod · 0.80
endMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected