| 577 | } |
| 578 | |
| 579 | bool CoreML::hasIOS14Features(const Specification::Model& model) { |
| 580 | // New IOS14 features: |
| 581 | // - new layers in Neural Network |
| 582 | // - Non-zero values for optional inputs |
| 583 | // - VisionFeaturePrint.Object |
| 584 | // - Float32 input/output for Non-Maximum Suppression |
| 585 | // - Apple Word Tagger using transfer learning (revision == 3) |
| 586 | |
| 587 | return walkModelAndPipeline( |
| 588 | model, |
| 589 | [](const Specification::Model& m) { |
| 590 | switch (m.Type_case()) { |
| 591 | case Specification::Model::kSerializedModel: |
| 592 | // SerializedModel proto message was added in ios14 |
| 593 | return true; |
| 594 | case Specification::Model::kWordTagger: |
| 595 | if (m.wordtagger().revision() == 3) { |
| 596 | return true; |
| 597 | } |
| 598 | break; |
| 599 | default: |
| 600 | break; |
| 601 | } |
| 602 | return |
| 603 | hasIOS14NeuralNetworkFeatures(m) || |
| 604 | isObjectPrint(m) || |
| 605 | nonMaxSuppressionUsesFloat32InputsOrOutputs(m); |
| 606 | }); |
| 607 | } |
| 608 | |
| 609 | bool CoreML::hasIOS15Features(const Specification::Model& model) { |
| 610 | // New in IOS15 features: |
nothing calls this directly
no test coverage detected