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

Method getCustomLayerNamesAndDescriptions

mlmodel/src/Utils.cpp:174–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174std::vector<StringPair> CoreML::getCustomLayerNamesAndDescriptions(const Specification::Model& model) {
175 std::vector<std::pair<std::string, std::string> > retval;
176 walkModelAndPipeline(model, [&retval](const auto& m) {
177 if (const auto *layers = getNNSpec(m)) {
178 for (const auto& layer: *layers) {
179 if (layer.layer_case() == Specification::NeuralNetworkLayer::kCustom) {
180 retval.push_back(std::make_pair(layer.custom().classname(), layer.custom().description()));
181 }
182 }
183 }
184 return false; // Do not stop walking
185 });
186 return retval;
187}
188
189std::vector<std::pair<std::string, std::string> > CoreML::getCustomModelNamesAndDescriptions(const Specification::Model& model) {
190 std::vector<std::pair<std::string, std::string> > retval;

Callers

nothing calls this directly

Calls 3

walkModelAndPipelineFunction · 0.85
push_backMethod · 0.80
descriptionMethod · 0.80

Tested by

no test coverage detected