| 236 | |
| 237 | template <typename NT, typename... Ts> |
| 238 | inline NodeID Graph::add_node(Ts &&...args) |
| 239 | { |
| 240 | arm_compute::lock_guard<arm_compute::Mutex> lock(_mtx); |
| 241 | |
| 242 | // Create node |
| 243 | NodeID nid = _nodes.size(); |
| 244 | auto node = std::make_unique<NT>(std::forward<Ts>(args)...); |
| 245 | node->set_graph(this); |
| 246 | node->set_id(nid); |
| 247 | |
| 248 | // Keep track of input nodes |
| 249 | _tagged_nodes[node->type()].push_back(nid); |
| 250 | |
| 251 | // Associate a new tensor with each output |
| 252 | for (auto &output : node->_outputs) |
| 253 | { |
| 254 | output = create_tensor(); |
| 255 | } |
| 256 | |
| 257 | // Propagate node shape if possible |
| 258 | node->forward_descriptors(); |
| 259 | |
| 260 | // Add node to the graph nodes |
| 261 | _nodes.push_back(std::move(node)); |
| 262 | |
| 263 | return nid; |
| 264 | } |
| 265 | } // namespace graph |
| 266 | } // namespace arm_compute |
| 267 | #endif // ACL_ARM_COMPUTE_GRAPH_GRAPH_H |
nothing calls this directly
no test coverage detected