MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / InitProgram

Function InitProgram

test/cpp/inference/test_helper.h:124–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124std::unique_ptr<paddle::framework::ProgramDesc> InitProgram(
125 paddle::framework::Executor* executor,
126 paddle::framework::Scope* scope,
127 const std::string& dirname,
128 const bool is_combined = false,
129 const std::string& prog_filename = "__model_combined__",
130 const std::string& param_filename = "__params_combined__") {
131 std::unique_ptr<paddle::framework::ProgramDesc> inference_program;
132 if (is_combined) {
133 // All parameters are saved in a single file.
134 // Hard-coding the file names of program and parameters in unittest.
135 // The file names should be consistent with that used in Python API
136 // `fluid.io.save_inference_model`.
137 inference_program = paddle::inference::Load(executor,
138 scope,
139 dirname + "/" + prog_filename,
140 dirname + "/" + param_filename);
141 } else {
142 // Parameters are saved in separate files sited in the specified
143 // `dirname`.
144 inference_program = paddle::inference::Load(executor, scope, dirname);
145 }
146 return inference_program;
147}
148
149std::vector<std::vector<int64_t>> GetFeedTargetShapes(
150 const std::string& dirname,

Callers 2

GetFeedTargetShapesFunction · 0.85
TestInferenceFunction · 0.85

Calls 1

LoadClass · 0.50

Tested by

no test coverage detected