MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / RunRestoreCheckpoint

Function RunRestoreCheckpoint

serving/processor/serving/util.cc:182–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182Status RunRestoreCheckpoint(
183 const RunOptions& run_options,
184 const std::string& full_ckpt_name,
185 const std::string& savedmodel_dir,
186 const StringPiece restore_op_name,
187 const StringPiece variable_filename_const_op_name,
188 const StringPiece incr_variable_filename_const_op_name,
189 const std::vector<AssetFileDef>& asset_file_defs,
190 Session* session) {
191 LOG(INFO) << "Restoring checkpoint.";
192 // Find path to variables to be restored in export directory.
193 // Add variables to the graph.
194 Tensor variables_path_tensor(DT_STRING, TensorShape({}));
195 variables_path_tensor.scalar<string>()() = full_ckpt_name;
196
197 std::vector<std::pair<string, Tensor>> inputs = {
198 {string(variable_filename_const_op_name), variables_path_tensor}};
199
200 util::AddAssetsTensorsToInputs(savedmodel_dir, asset_file_defs, &inputs);
201
202 RunMetadata run_metadata;
203 return util::RunOnce(run_options, inputs, {}, {string(restore_op_name)},
204 nullptr /* outputs */, &run_metadata, session);
205}
206
207
208Status RunRestore(const RunOptions& run_options, const string& export_dir,

Callers 1

CreateModelSessionMethod · 0.85

Calls 3

AddAssetsTensorsToInputsFunction · 0.70
RunOnceFunction · 0.70
TensorShapeClass · 0.50

Tested by

no test coverage detected