Resets executor_ with a new executor based on a graph 'gdef'.
| 58 | |
| 59 | // Resets executor_ with a new executor based on a graph 'gdef'. |
| 60 | void Create(std::unique_ptr<const Graph> graph) { |
| 61 | const int version = graph->versions().producer(); |
| 62 | LocalExecutorParams params; |
| 63 | params.device = device_.get(); |
| 64 | params.create_kernel = [this, version](const NodeDef& ndef, |
| 65 | OpKernel** kernel) { |
| 66 | return CreateNonCachedKernel(device_.get(), nullptr, ndef, version, |
| 67 | kernel); |
| 68 | }; |
| 69 | params.delete_kernel = [](OpKernel* kernel) { |
| 70 | DeleteNonCachedKernel(kernel); |
| 71 | }; |
| 72 | rendez_ = NewLocalRendezvous(); |
| 73 | params.rendezvous_factory = [this](const int64, const DeviceMgr*, |
| 74 | Rendezvous** r) { |
| 75 | *r = rendez_; |
| 76 | rendez_->Ref(); |
| 77 | return Status::OK(); |
| 78 | }; |
| 79 | delete exec_; |
| 80 | TF_CHECK_OK(NewLocalExecutor(params, std::move(graph), &exec_)); |
| 81 | runner_ = [this](std::function<void()> fn) { thread_pool_->Schedule(fn); }; |
| 82 | cost_runner_ = [this](std::function<void()> fn, int64 cost) |
| 83 | { thread_pool_->CostSchedule(fn, cost); }; |
| 84 | } |
| 85 | |
| 86 | Status Run(Rendezvous* rendez) { |
| 87 | Executor::Args args; |
nothing calls this directly
no test coverage detected