| 423 | |
| 424 | |
| 425 | static bool hasOpsets(const Specification::Model& model, const std::string& opset) { |
| 426 | return walkModelAndPipeline( |
| 427 | model, |
| 428 | [opset](const Specification::Model& m) { |
| 429 | if (m.Type_case() != Specification::Model::kMlProgram) { |
| 430 | return false; |
| 431 | } |
| 432 | |
| 433 | auto main_iter = m.mlprogram().functions().find("main"); |
| 434 | if (main_iter != m.mlprogram().functions().end()) { |
| 435 | const auto& main = main_iter->second; |
| 436 | if (main.opset() == opset) { |
| 437 | return true; |
| 438 | } |
| 439 | } |
| 440 | return false; |
| 441 | }); |
| 442 | } |
| 443 | |
| 444 | static bool hasCoreML8Opsets(const Specification::Model& model) { |
| 445 | return hasOpsets(model, "CoreML8"); |
no test coverage detected