Runs an operation producing 'num_outputs' outputs. Returns the context's status after running the operation.
| 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 | // |
nothing calls this directly
no test coverage detected