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

Function RunInitOp

serving/processor/serving/util.cc:368–382  ·  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

366// RunInitOp will return OK if the initialization op was run successfully.
367// An empty init_op_name indicates that there are no init ops to run.
368Status RunInitOp(const RunOptions& run_options, const string& export_dir,
369 const MetaGraphDef& meta_graph_def,
370 const std::vector<AssetFileDef>& asset_file_defs,
371 Session* session, const string& init_op_name) {
372 if (!init_op_name.empty()) {
373 LOG(INFO) << "Running initialization op on SavedModel bundle at path: "
374 << export_dir;
375 std::vector<std::pair<string, Tensor>> inputs;
376 AddAssetsTensorsToInputs(export_dir, asset_file_defs, &inputs);
377 RunMetadata run_metadata;
378 return RunOnce(run_options, inputs, {}, {init_op_name},
379 nullptr /* outputs */, &run_metadata, session);
380 }
381 return Status::OK();
382}
383
384Status GetInitOp(const string& export_dir, const MetaGraphDef& meta_graph_def,
385 string* init_op_name) {

Callers 1

CreateModelSessionMethod · 0.70

Calls 3

AddAssetsTensorsToInputsFunction · 0.70
RunOnceFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected