| 781 | } |
| 782 | |
| 783 | Status MasterSession::ReffedClientGraph::RunPartitions( |
| 784 | const MasterEnv* env, int64 step_id, int64 execution_count, |
| 785 | PerStepState* pss, CallOptions* call_opts, const RunStepRequestWrapper& req, |
| 786 | MutableRunStepResponseWrapper* resp, CancellationManager* cm, |
| 787 | const bool is_last_partial_run) { |
| 788 | VLOG(2) << "RunPartitions step_id " << step_id << " execution_count " |
| 789 | << execution_count; |
| 790 | // Maps the names of fed tensors to their index in `req`. |
| 791 | std::unordered_map<StringPiece, size_t, StringPieceHasher> feeds(3); |
| 792 | for (size_t i = 0; i < req.num_feeds(); ++i) { |
| 793 | if (!feeds.insert({req.feed_name(i), i}).second) { |
| 794 | return errors::InvalidArgument("Duplicated feeds: ", req.feed_name(i)); |
| 795 | } |
| 796 | } |
| 797 | |
| 798 | std::vector<string> fetches; |
| 799 | fetches.reserve(req.num_fetches()); |
| 800 | for (size_t i = 0; i < req.num_fetches(); ++i) { |
| 801 | fetches.push_back(req.fetch_name(i)); |
| 802 | } |
| 803 | |
| 804 | return RunPartitionsHelper(feeds, fetches, env, step_id, execution_count, pss, |
| 805 | call_opts, req, resp, cm, is_last_partial_run); |
| 806 | } |
| 807 | |
| 808 | Status MasterSession::ReffedClientGraph::RunPartitions( |
| 809 | const MasterEnv* env, int64 step_id, int64 execution_count, |