@@ -93,15 +93,15 @@ void CheckError(const paddle::framework::LoDTensor& output1,
93
93
94
94
std::unique_ptr<paddle::framework::ProgramDesc> InitProgram (
95
95
paddle::framework::Executor* executor, paddle::framework::Scope* scope,
96
- const std::string& dirname, const bool is_combined = false ) {
96
+ const std::string& dirname, const bool is_combined = false ,
97
+ const std::string& prog_filename = " __model_combined__" ,
98
+ const std::string& param_filename = " __params_combined__" ) {
97
99
std::unique_ptr<paddle::framework::ProgramDesc> inference_program;
98
100
if (is_combined) {
99
101
// All parameters are saved in a single file.
100
102
// Hard-coding the file names of program and parameters in unittest.
101
103
// The file names should be consistent with that used in Python API
102
104
// `fluid.io.save_inference_model`.
103
- std::string prog_filename = " model" ;
104
- std::string param_filename = " params" ;
105
105
inference_program =
106
106
paddle::inference::Load (executor, scope, dirname + " /" + prog_filename,
107
107
dirname + " /" + param_filename);
@@ -114,12 +114,15 @@ std::unique_ptr<paddle::framework::ProgramDesc> InitProgram(
114
114
}
115
115
116
116
std::vector<std::vector<int64_t >> GetFeedTargetShapes (
117
- const std::string& dirname, const bool is_combined = false ) {
117
+ const std::string& dirname, const bool is_combined = false ,
118
+ const std::string& prog_filename = " __model_combined__" ,
119
+ const std::string& param_filename = " __params_combined__" ) {
118
120
auto place = paddle::platform::CPUPlace ();
119
121
auto executor = paddle::framework::Executor (place);
120
122
auto * scope = new paddle::framework::Scope ();
121
123
122
- auto inference_program = InitProgram (&executor, scope, dirname, is_combined);
124
+ auto inference_program = InitProgram (&executor, scope, dirname, is_combined,
125
+ prog_filename, param_filename);
123
126
auto & global_block = inference_program->Block (0 );
124
127
125
128
const std::vector<std::string>& feed_target_names =
0 commit comments