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

Method findItemsByAuthor

modelpackage/src/ModelPackage.cpp:491–507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

489}
490
491std::vector<ModelPackageItemInfo> ModelPackageImpl::findItemsByAuthor(const std::string& author) const
492{
493 auto itemInfoVector = std::vector<ModelPackageItemInfo>();
494 auto itemInfoEntries = getItemInfoEntries();
495 if (itemInfoEntries != nullptr) {
496 std::vector<std::string> identifiers;
497 itemInfoEntries->getKeys(identifiers);
498 for (const auto& identifier : identifiers) {
499 auto itemInfo = findItem(identifier);
500 if (itemInfo->author() == author) {
501 itemInfoVector.push_back(*itemInfo);
502 }
503 }
504 }
505
506 return itemInfoVector;
507}
508
509void ModelPackageImpl::removeItem(const std::string& identifier)
510{

Callers

nothing calls this directly

Calls 3

getKeysMethod · 0.80
push_backMethod · 0.80
authorMethod · 0.45

Tested by

no test coverage detected