| 189 | } // anonymous namespace |
| 190 | |
| 191 | Result validateFunctionNodeInputs(const GraphFunction& func) { |
| 192 | Result res; |
| 193 | |
| 194 | // make sure they all get the context |
| 195 | auto funcCtx = |
| 196 | res.addScopedContext({{"function", func.name()}, {"module", func.module().fullName()}}); |
| 197 | |
| 198 | auto entry = func.entryNode(); |
| 199 | |
| 200 | if (entry == nullptr) { |
| 201 | return res; |
| 202 | // TODO: should this be an error? |
| 203 | } |
| 204 | |
| 205 | std::unordered_map<const NodeInstance*, std::vector<int>> alreadyCalled; |
| 206 | alreadyCalled.emplace(entry, std::vector<int>{}); |
| 207 | |
| 208 | // no need to create a processed because you can't create a loop with entry in it |
| 209 | |
| 210 | for (const auto& conn : entry->outputExecConnections) { |
| 211 | if (conn.first == nullptr) { continue; } |
| 212 | res += validatePath(*conn.first, conn.second, alreadyCalled); |
| 213 | } |
| 214 | |
| 215 | return res; |
| 216 | } |
| 217 | |
| 218 | Result validateFunctionExecOutputs(const GraphFunction& func) { |
| 219 | // make sure all exec outputs exist, and raise an error otherwise. |
no test coverage detected