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

Method load

mlmodel/src/Model.cpp:166–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164 }
165
166 Result Model::load(std::istream& in, Model& out) {
167 if (!in.good()) {
168 return Result(ResultType::UNABLE_TO_OPEN_FILE,
169 "unable to open file for read");
170 }
171
172
173 Result r = loadSpecification(*(out.m_spec), in);
174 if (!r.good()) { return r; }
175 // validate on load
176
177 r = out.validate();
178
179 return r;
180 }
181
182 Result Model::load(const std::string& path, Model& out) {
183 std::ifstream in(path, std::ios::binary);

Callers

nothing calls this directly

Calls 5

ResultClass · 0.85
loadSpecificationFunction · 0.85
goodMethod · 0.80
loadFunction · 0.50
validateMethod · 0.45

Tested by

no test coverage detected