| 317 | } |
| 318 | |
| 319 | Status HandleFromInput(OpKernelContext* ctx, StringPiece input, |
| 320 | ResourceHandle* handle) { |
| 321 | const Tensor* tensor; |
| 322 | TF_RETURN_IF_ERROR(ctx->input(input, &tensor)); |
| 323 | *handle = tensor->flat<ResourceHandle>()(0); |
| 324 | return Status::OK(); |
| 325 | } |
| 326 | |
| 327 | Status DeleteResource(OpKernelContext* ctx, const ResourceHandle& p) { |
| 328 | TF_RETURN_IF_ERROR(internal::ValidateDevice(ctx, p)); |