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

Function RunInitOp

tensorflow/cc/saved_model/loader.cc:227–241  ·  view source on GitHub ↗

RunInitOp will return OK if the initialization op was run successfully. An empty init_op_name indicates that there are no init ops to run.

Source from the content-addressed store, hash-verified

225// RunInitOp will return OK if the initialization op was run successfully.
226// An empty init_op_name indicates that there are no init ops to run.
227Status RunInitOp(const RunOptions& run_options, const string& export_dir,
228 const MetaGraphDef& meta_graph_def,
229 const std::vector<AssetFileDef>& asset_file_defs,
230 Session* session, const string& init_op_name) {
231 if (!init_op_name.empty()) {
232 LOG(INFO) << "Running initialization op on SavedModel bundle at path: "
233 << export_dir;
234 std::vector<std::pair<string, Tensor>> inputs;
235 AddAssetsTensorsToInputs(export_dir, asset_file_defs, &inputs);
236 RunMetadata run_metadata;
237 return RunOnce(run_options, inputs, {}, {init_op_name},
238 nullptr /* outputs */, &run_metadata, session);
239 }
240 return Status::OK();
241}
242
243// A SavedModel may store the name of the initialization op to run in the
244// in the SignatureDef (v2) or a collection (v1). If an init_op collection

Callers 1

LoadSavedModelInternalFunction · 0.70

Calls 3

AddAssetsTensorsToInputsFunction · 0.70
RunOnceFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected