| 122 | } |
| 123 | |
| 124 | std::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 | |
| 149 | std::vector<std::vector<int64_t>> GetFeedTargetShapes( |
| 150 | const std::string& dirname, |
no test coverage detected