MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle-Lite / LoadProgram

Function LoadProgram

lite/model_parser/model_parser.cc:56–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56std::unique_ptr<framework::proto::ProgramDesc> LoadProgram(
57 const std::string &path, const lite_api::CxxModelBuffer &model_buffer) {
58 std::unique_ptr<framework::proto::ProgramDesc> main_program(
59 new framework::proto::ProgramDesc);
60 if (model_buffer.is_empty()) {
61 model_parser::BinaryFileReader file(path);
62 main_program->ParseFromString(file.ReadToString(file.length()));
63 } else {
64 main_program->ParseFromString(model_buffer.get_program());
65 }
66 return main_program;
67}
68
69// Load directly to CPU, and latter transfer to other devices.
70void LoadParam(const std::string &path, Variable *out) {

Callers 4

RunFunction · 0.85
CheckIfModelSupportedMethod · 0.85
TESTFunction · 0.85
LoadModelPbFunction · 0.85

Calls 3

is_emptyMethod · 0.80
ReadToStringMethod · 0.80
lengthMethod · 0.45

Tested by 1

TESTFunction · 0.68