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

Method RecvPRunOutputs

tensorflow/core/common_runtime/direct_session.cc:1779–1823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1777}
1778
1779Status DirectSession::RecvPRunOutputs(
1780 const std::vector<string>& output_names,
1781 const ExecutorsAndKeys* executors_and_keys, RunState* run_state,
1782 std::vector<Tensor>* outputs) {
1783 Status s;
1784 if (!output_names.empty()) {
1785 outputs->resize(output_names.size());
1786 }
1787
1788 Rendezvous::ParsedKey parsed;
1789 // Get the outputs from the rendezvous
1790 for (size_t output_offset = 0; output_offset < output_names.size();
1791 ++output_offset) {
1792 const string& output_name = output_names[output_offset];
1793 auto it =
1794 executors_and_keys->output_name_to_rendezvous_key.find(output_name);
1795 if (it == executors_and_keys->output_name_to_rendezvous_key.end()) {
1796 return errors::Internal("'", output_name,
1797 "' is not a pre-defined fetch.");
1798 }
1799 const string& output_key = it->second;
1800 Tensor output_tensor;
1801 bool is_dead;
1802 IntraProcessRendezvous* rendez = run_state->rendez;
1803
1804 s = Rendezvous::ParseKey(output_key, &parsed);
1805 if (s.ok()) {
1806 // Fetch data from the Rendezvous.
1807 s = rendez->Recv(parsed, Rendezvous::Args(), &output_tensor, &is_dead,
1808 operation_timeout_in_ms_);
1809 if (is_dead && s.ok()) {
1810 s = errors::InvalidArgument("The tensor returned for ", output_name,
1811 " was not valid.");
1812 }
1813 }
1814 if (!s.ok()) {
1815 rendez->StartAbort(s);
1816 outputs->clear();
1817 return s;
1818 }
1819
1820 (*outputs)[output_offset] = output_tensor;
1821 }
1822 return Status::OK();
1823}
1824
1825Status DirectSession::CheckFetch(const NamedTensorList& feeds,
1826 const std::vector<string>& fetches,

Callers

nothing calls this directly

Calls 12

InternalFunction · 0.85
InvalidArgumentFunction · 0.85
ArgsClass · 0.70
emptyMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45
endMethod · 0.45
okMethod · 0.45
RecvMethod · 0.45
StartAbortMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected