| 72 | } |
| 73 | |
| 74 | Status KernelAndDeviceOp::Init(const NodeDef& ndef, |
| 75 | GraphCollector* graph_collector) { |
| 76 | OpKernel* k = nullptr; |
| 77 | if (flr_ == nullptr) { |
| 78 | return errors::Internal( |
| 79 | "A valid FunctionLibraryRuntime must be provided when running ops " |
| 80 | "based on OpKernel."); |
| 81 | } |
| 82 | TF_RETURN_IF_ERROR(flr_->CreateKernel(ndef, &k)); |
| 83 | kernel_.reset(k); |
| 84 | return Status::OK(); |
| 85 | } |
| 86 | |
| 87 | Status KernelAndDeviceFunc::Init(const NodeDef& ndef, |
| 88 | GraphCollector* graph_collector) { |