| 807 | } |
| 808 | |
| 809 | static bool hasIOS12NewNeuralNetworkLayers(const Specification::Model& model) { |
| 810 | |
| 811 | // Return True if the model has the two new NN layers added in iOS 12, which are |
| 812 | // resizeBilinear and CropResize |
| 813 | |
| 814 | return walkModelAndPipeline( |
| 815 | model, |
| 816 | [](const Specification::Model& m) { |
| 817 | if (const auto *layers = getNNSpec(m)) { |
| 818 | for (const auto& layer: *layers) { |
| 819 | if (layer.layer_case() == Specification::NeuralNetworkLayer::kResizeBilinear || |
| 820 | layer.layer_case() == Specification::NeuralNetworkLayer::kCropResize) { |
| 821 | return true; |
| 822 | } |
| 823 | } |
| 824 | } |
| 825 | return false; |
| 826 | }); |
| 827 | } |
| 828 | |
| 829 | bool CoreML::isIOS12NeuralNetworkLayer(const Specification::NeuralNetworkLayer& layer) { |
| 830 |
no test coverage detected