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

Function PYBIND11_PLUGIN

modelpackage/src/ModelPackagePython.cpp:24–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace py = pybind11;
23
24PYBIND11_PLUGIN(libmodelpackage) {
25 py::module m("libmodelpackage", "Library to create, access and edit model packages");
26
27 py::class_<MPL::ModelPackageItemInfo, std::shared_ptr<MPL::ModelPackageItemInfo>>(m, "ModelPackageItemInfo")
28 .def("identifier", &MPL::ModelPackageItemInfo::identifier)
29 .def("path", &MPL::ModelPackageItemInfo::path)
30 .def("name", &MPL::ModelPackageItemInfo::name)
31 .def("author", &MPL::ModelPackageItemInfo::author)
32 .def("description", &MPL::ModelPackageItemInfo::description);
33
34 py::class_<MPL::ModelPackage>(m, "ModelPackage")
35 .def(py::init<const std::string&>())
36 .def("path", &MPL::ModelPackage::path)
37 .def("setRootModel", &MPL::ModelPackage::setRootModel)
38 .def("replaceRootModel", &MPL::ModelPackage::replaceRootModel)
39 .def("addItem", &MPL::ModelPackage::addItem)
40 .def("getRootModel", &MPL::ModelPackage::getRootModel)
41 .def("isValid", &MPL::ModelPackage::isValid)
42 .def("findItemByNameAuthor", py::overload_cast<const std::string&, const std::string&>(&MPL::ModelPackage::findItem, py::const_));
43
44 return m.ptr();
45}
46
47#pragma clang diagnostic pop

Callers

nothing calls this directly

Calls 1

ptrMethod · 0.80

Tested by

no test coverage detected