| 99 | } |
| 100 | |
| 101 | bool Graph::AddOutputNode(const std::string& node_name) |
| 102 | { |
| 103 | Node* node = FindNode(node_name); |
| 104 | |
| 105 | if(node == nullptr) |
| 106 | return false; |
| 107 | |
| 108 | // check to avoid replicate node |
| 109 | |
| 110 | for(unsigned int i = 0; i < output_nodes.size(); i++) |
| 111 | { |
| 112 | if(node == output_nodes[i]) |
| 113 | return true; |
| 114 | } |
| 115 | |
| 116 | output_nodes.push_back(node); |
| 117 | |
| 118 | return true; |
| 119 | } |
| 120 | |
| 121 | Tensor* Graph::FindTensor(const std::string& tensor_name) |
| 122 | { |