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

Method Create

tensorflow/core/common_runtime/executor_test.cc:60–84  ·  view source on GitHub ↗

Resets executor_ with a new executor based on a graph 'gdef'.

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 9

CreateNonCachedKernelFunction · 0.85
DeleteNonCachedKernelFunction · 0.85
NewLocalRendezvousFunction · 0.85
NewLocalExecutorFunction · 0.85
CostScheduleMethod · 0.80
versionsMethod · 0.45
getMethod · 0.45
RefMethod · 0.45
ScheduleMethod · 0.45

Tested by

no test coverage detected