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

Function RunIncrMainOp

serving/processor/serving/util.cc:245–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245Status RunIncrMainOp(const RunOptions& run_options, const string& export_dir,
246 const MetaGraphDef& meta_graph_def,
247 const std::vector<AssetFileDef>& asset_file_defs,
248 Session* session, const string& main_op_key,
249 thread::ThreadPoolOptions thread_opt,
250 Session::CallableHandle** handler) {
251 LOG(INFO) << "Running MainOp with key " << main_op_key
252 << " on SavedModel bundle.";
253 const auto& collection_def_map = meta_graph_def.collection_def();
254 const auto main_op_it = collection_def_map.find(main_op_key);
255 if (main_op_it != collection_def_map.end()) {
256 if (main_op_it->second.node_list().value_size() != 1) {
257 return errors::FailedPrecondition(
258 strings::StrCat("Expected exactly one main op in : ", export_dir));
259 }
260 std::vector<std::pair<string, Tensor>> inputs;
261 util::AddAssetsTensorsToInputs(export_dir, asset_file_defs, &inputs);
262 RunMetadata run_metadata;
263 const StringPiece main_op_name = main_op_it->second.node_list().value(0);
264 return util::RunOnce(run_options, inputs, {}, {string(main_op_name)},
265 nullptr /* outputs */, &run_metadata, session, thread_opt, handler);
266 }
267 return Status::OK();
268}
269
270Status RunMainOp(const RunOptions& run_options, const string& export_dir,
271 const MetaGraphDef& meta_graph_def,

Callers 1

CreateModelSessionMethod · 0.85

Calls 7

FailedPreconditionFunction · 0.85
AddAssetsTensorsToInputsFunction · 0.70
RunOnceFunction · 0.70
StrCatFunction · 0.50
findMethod · 0.45
endMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected