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

Function loadSpecification

mlmodel/src/Utils.hpp:44–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42
43 template <typename T>
44 static inline Result loadSpecification(T& formatObj,
45 std::istream& in) {
46
47 google::protobuf::io::IstreamInputStream rawInput(&in);
48 google::protobuf::io::CodedInputStream codedInput(&rawInput);
49
50 // Support models up to 2GB
51 codedInput.SetTotalBytesLimit(std::numeric_limits<int>::max());
52
53 if (!formatObj.ParseFromCodedStream(&codedInput)) {
54 return Result(ResultType::FAILED_TO_DESERIALIZE,
55 "unable to deserialize object");
56 }
57
58 return Result();
59 }
60
61 static inline Result loadSpecificationPath(Specification::Model& formatObj,
62 const std::string& path) {

Callers 1

loadMethod · 0.85

Calls 4

maxFunction · 0.85
ResultClass · 0.85
SetTotalBytesLimitMethod · 0.80
ParseFromCodedStreamMethod · 0.45

Tested by

no test coverage detected