| 232 | } |
| 233 | |
| 234 | void SetNodePort(std::vector<NodePortPtr>& port_list, int idx, Tensor* tensor) |
| 235 | { |
| 236 | NodePort* port = new NodePort(); |
| 237 | |
| 238 | port->owner = this; |
| 239 | port->port_index = idx; |
| 240 | port->tensor = tensor; |
| 241 | auto ir = port_list.begin(); |
| 242 | |
| 243 | while(ir != port_list.end()) |
| 244 | { |
| 245 | if((*ir)->port_index == idx) |
| 246 | { |
| 247 | (*ir).reset(port); |
| 248 | return; |
| 249 | } |
| 250 | ir++; |
| 251 | } |
| 252 | |
| 253 | port_list.push_back(NodePortPtr(port)); |
| 254 | } |
| 255 | |
| 256 | bool RemoveOutputPort(int idx) |
| 257 | { |