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

Function RunOnce

serving/processor/serving/util.cc:59–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59Status RunOnce(
60 const RunOptions& run_options,
61 const std::vector<std::pair<string, Tensor>>& inputs,
62 const std::vector<string>& output_tensor_names,
63 const std::vector<string>& target_node_names,
64 std::vector<Tensor>* outputs, RunMetadata* run_metadata,
65 Session* session) {
66 CallableOptions callable_options;
67 std::vector<Tensor> feed_tensors;
68 *callable_options.mutable_run_options() = run_options;
69 for (const auto& input : inputs) {
70 const string& name = input.first;
71 const Tensor& tensor = input.second;
72 callable_options.add_feed(name);
73 feed_tensors.push_back(tensor);
74 }
75 for (const string& output_tensor_name : output_tensor_names) {
76 callable_options.add_fetch(output_tensor_name);
77 }
78 for (const string& target_node_name : target_node_names) {
79 callable_options.add_target(target_node_name);
80 }
81
82 Session::CallableHandle callable_handle;
83 TF_RETURN_IF_ERROR(session->MakeCallable(callable_options, &callable_handle));
84
85 const Status run_status = session->RunCallable(callable_handle, feed_tensors,
86 outputs, run_metadata);
87 // Be sure to call ReleaseCallable() regardless of the outcome of
88 // RunCallable().
89 session->ReleaseCallable(callable_handle).IgnoreError();
90
91 return run_status;
92}
93
94Status RunOnce(
95 const RunOptions& run_options,

Callers 6

RunIncrRestoreCheckpointFunction · 0.70
RunRestoreCheckpointFunction · 0.70
RunRestoreFunction · 0.70
RunIncrMainOpFunction · 0.70
RunMainOpFunction · 0.70
RunInitOpFunction · 0.70

Calls 9

mutable_run_optionsMethod · 0.80
add_targetMethod · 0.80
add_feedMethod · 0.45
push_backMethod · 0.45
add_fetchMethod · 0.45
MakeCallableMethod · 0.45
RunCallableMethod · 0.45
IgnoreErrorMethod · 0.45
ReleaseCallableMethod · 0.45

Tested by

no test coverage detected