MCPcopy Create free account
hub / github.com/apple/coremltools / hasIOS12NewNeuralNetworkLayers

Function hasIOS12NewNeuralNetworkLayers

mlmodel/src/Utils.cpp:809–827  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

807}
808
809static 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
829bool CoreML::isIOS12NeuralNetworkLayer(const Specification::NeuralNetworkLayer& layer) {
830

Callers 1

hasIOS12FeaturesMethod · 0.85

Calls 1

walkModelAndPipelineFunction · 0.85

Tested by

no test coverage detected