| 494 | } |
| 495 | |
| 496 | bool CoreML::hasIOS13Features(const Specification::Model& model) { |
| 497 | // New IOS13 features: |
| 498 | // - no constraint on rank for NN inputs |
| 499 | // - model is marked as updatable |
| 500 | // |
| 501 | // - model is of type kKNearestNeighborsClassifier |
| 502 | // - model is of type LinkedModel |
| 503 | // - model is of type kItemSimilarityRecommender |
| 504 | // - model is of sound analysis preprocessing |
| 505 | // |
| 506 | // - model is of type TextClassifier with revision == 2 |
| 507 | // - model is of type Gazetteer with revision == 2 |
| 508 | // - model is of type WordEmbedding with revision == 2 |
| 509 | |
| 510 | return walkModelAndPipeline( |
| 511 | model, |
| 512 | [](const Specification::Model& m) { |
| 513 | if (m.isupdatable()) { |
| 514 | return true; |
| 515 | } |
| 516 | |
| 517 | switch (m.Type_case()) { |
| 518 | case Specification::Model::kKNearestNeighborsClassifier: |
| 519 | case Specification::Model::kLinkedModel: |
| 520 | case Specification::Model::kItemSimilarityRecommender: |
| 521 | case Specification::Model::kSoundAnalysisPreprocessing: |
| 522 | return true; |
| 523 | case Specification::Model::kTextClassifier: |
| 524 | if (m.textclassifier().revision() == 2) { |
| 525 | return true; |
| 526 | } |
| 527 | break; |
| 528 | case Specification::Model::kGazetteer: |
| 529 | if (m.gazetteer().revision() == 2) { |
| 530 | return true; |
| 531 | } |
| 532 | break; |
| 533 | case Specification::Model::kWordEmbedding: |
| 534 | if (m.wordembedding().revision() == 2) { |
| 535 | return true; |
| 536 | } |
| 537 | break; |
| 538 | default: |
| 539 | break; |
| 540 | } |
| 541 | return hasIOS13NeuralNetworkFeatures(m); |
| 542 | }); |
| 543 | } |
| 544 | |
| 545 | static bool hasDefaultValueForOptionalInputs(const Specification::Model& model) { |
| 546 | // Checks if default optional value has been set or not |
nothing calls this directly
no test coverage detected