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

Function hasDefaultValueForOptionalInputs

mlmodel/src/Utils.cpp:545–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

543}
544
545static bool hasDefaultValueForOptionalInputs(const Specification::Model& model) {
546 // Checks if default optional value has been set or not
547 return anyFeatureDescriptionOfModel(
548 model,
549 [](const auto& fd) {
550 if (fd.type().Type_case() == Specification::FeatureType::kMultiArrayType && fd.type().isoptional()){
551 switch (fd.type().multiarraytype().defaultOptionalValue_case()) {
552 case CoreML::Specification::ArrayFeatureType::kDoubleDefaultValue:
553 case CoreML::Specification::ArrayFeatureType::kFloatDefaultValue:
554 case CoreML::Specification::ArrayFeatureType::kIntDefaultValue:
555 return true;
556 default:
557 break;
558 }
559 }
560 return false;
561 });
562}
563
564static bool nonMaxSuppressionUsesFloat32InputsOrOutputs(const Specification::Model& model) {
565 if (!isNonMaxSuppression(model)) {

Callers 1

Calls 2

typeMethod · 0.45

Tested by

no test coverage detected