We'll check if the model has ONLY the IOS12 shape specifications if the old ones are also filled in with something plausible, then there is nothing preventing us from running on older versions of Core ML.
| 386 | // if the old ones are also filled in with something plausible, then there is nothing |
| 387 | // preventing us from running on older versions of Core ML. |
| 388 | static bool hasFlexibleShapes(const Specification::Model& model) { |
| 389 | return anyFeatureDescriptionOfModel( |
| 390 | model, |
| 391 | [](const auto& fd) { |
| 392 | if (fd.type().Type_case() == Specification::FeatureType::kMultiArrayType && |
| 393 | fd.type().multiarraytype().ShapeFlexibility_case() != Specification::ArrayFeatureType::SHAPEFLEXIBILITY_NOT_SET) { |
| 394 | return true; |
| 395 | } else if (fd.type().Type_case() == Specification::FeatureType::kImageType && |
| 396 | fd.type().imagetype().SizeFlexibility_case() != Specification::ImageFeatureType::SIZEFLEXIBILITY_NOT_SET) { |
| 397 | return true; |
| 398 | } |
| 399 | return false; |
| 400 | }); |
| 401 | } |
| 402 | |
| 403 | static bool hasFloat16MultiArray(const Specification::Model& model) { |
| 404 | return anyFeatureDescriptionOfModel( |
no test coverage detected