| 1738 | } |
| 1739 | |
| 1740 | Status DirectSession::SendPRunInputs(const NamedTensorList& inputs, |
| 1741 | const ExecutorsAndKeys* executors_and_keys, |
| 1742 | IntraProcessRendezvous* rendez) { |
| 1743 | Status s; |
| 1744 | Rendezvous::ParsedKey parsed; |
| 1745 | // Insert the input tensors into the local rendezvous by their |
| 1746 | // rendezvous key. |
| 1747 | for (const auto& input : inputs) { |
| 1748 | auto it = |
| 1749 | executors_and_keys->input_name_to_rendezvous_key.find(input.first); |
| 1750 | if (it == executors_and_keys->input_name_to_rendezvous_key.end()) { |
| 1751 | return errors::Internal("'", input.first, "' is not a pre-defined feed."); |
| 1752 | } |
| 1753 | const string& input_key = it->second; |
| 1754 | |
| 1755 | s = Rendezvous::ParseKey(input_key, &parsed); |
| 1756 | if (!s.ok()) { |
| 1757 | rendez->StartAbort(s); |
| 1758 | return s; |
| 1759 | } |
| 1760 | |
| 1761 | if (input.second.dtype() == DT_RESOURCE) { |
| 1762 | Tensor tensor_from_handle; |
| 1763 | s = ResourceHandleToInputTensor(input.second, &tensor_from_handle); |
| 1764 | if (s.ok()) { |
| 1765 | s = rendez->Send(parsed, Rendezvous::Args(), tensor_from_handle, false); |
| 1766 | } |
| 1767 | } else { |
| 1768 | s = rendez->Send(parsed, Rendezvous::Args(), input.second, false); |
| 1769 | } |
| 1770 | |
| 1771 | if (!s.ok()) { |
| 1772 | rendez->StartAbort(s); |
| 1773 | return s; |
| 1774 | } |
| 1775 | } |
| 1776 | return Status::OK(); |
| 1777 | } |
| 1778 | |
| 1779 | Status DirectSession::RecvPRunOutputs( |
| 1780 | const std::vector<string>& output_names, |