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

Method RunOpKernel

tensorflow/core/kernels/ops_testutil.h:174–200  ·  view source on GitHub ↗

Runs an operation producing 'num_outputs' outputs. Returns the context's status after running the operation.

Source from the content-addressed store, hash-verified

172 //
173 // Returns the context's status after running the operation.
174 Status RunOpKernel() {
175 // Make sure the old OpKernelContext is deleted before the Params
176 // it was using.
177 context_.reset(nullptr);
178
179 // Delete the output copies from previous runs.
180 gtl::STLDeleteElements(&managed_outputs_);
181 managed_outputs_.resize(0);
182
183 params_.reset(new OpKernelContext::Params);
184 params_->device = device_;
185 params_->frame_iter = FrameAndIter(0, 0);
186 params_->inputs = &inputs_;
187 params_->op_kernel = kernel_.get();
188 step_container_.reset(new ScopedStepContainer(0, [](const string&) {}));
189 params_->step_container = step_container_.get();
190 std::vector<AllocatorAttributes> attrs;
191 test::SetOutputAttrs(params_.get(), &attrs);
192 checkpoint::TensorSliceReaderCacheWrapper slice_reader_cache_wrapper;
193 params_->slice_reader_cache = &slice_reader_cache_wrapper;
194 params_->resource_manager = device_->resource_manager();
195 params_->function_library = pflr_->GetFLR(device_->name());
196
197 context_.reset(new OpKernelContext(params_.get()));
198 device_->Compute(kernel_.get(), context_.get());
199 return context_->status();
200 }
201
202 // Returns the tensor input for 'input_index'.
203 //

Callers

nothing calls this directly

Calls 11

STLDeleteElementsFunction · 0.85
FrameAndIterClass · 0.85
SetOutputAttrsFunction · 0.85
GetFLRMethod · 0.80
nameMethod · 0.65
resetMethod · 0.45
resizeMethod · 0.45
getMethod · 0.45
resource_managerMethod · 0.45
ComputeMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected