| 144 | } |
| 145 | |
| 146 | std::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 | |
| 164 | void Translator::AddAsNode( |
| 165 | NodeDef* node_def, DAGDef* dag_def, |
nothing calls this directly
no test coverage detected