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

Function hasOpsets

mlmodel/src/Utils.cpp:425–442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423
424
425static bool hasOpsets(const Specification::Model& model, const std::string& opset) {
426 return walkModelAndPipeline(
427 model,
428 [opset](const Specification::Model& m) {
429 if (m.Type_case() != Specification::Model::kMlProgram) {
430 return false;
431 }
432
433 auto main_iter = m.mlprogram().functions().find("main");
434 if (main_iter != m.mlprogram().functions().end()) {
435 const auto& main = main_iter->second;
436 if (main.opset() == opset) {
437 return true;
438 }
439 }
440 return false;
441 });
442}
443
444static bool hasCoreML8Opsets(const Specification::Model& model) {
445 return hasOpsets(model, "CoreML8");

Callers 3

hasCoreML8OpsetsFunction · 0.85
hasCoreML7OpsetsFunction · 0.85
hasCoreML6OpsetsFunction · 0.85

Calls 3

walkModelAndPipelineFunction · 0.85
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected