| 417 | } |
| 418 | |
| 419 | void DeleteIteratorOp::Compute(OpKernelContext* ctx) { |
| 420 | ResourceHandle handle = ctx->input(0).flat<ResourceHandle>()(0); |
| 421 | // The iterator resource is guaranteed to exist because the variant tensor |
| 422 | // wrapping the deleter is provided as an unused input to this op, which |
| 423 | // guarantees that it has not run yet. |
| 424 | Status s = ctx->resource_manager()->Delete(handle); |
| 425 | if (errors::IsNotFound(s)) { |
| 426 | // TODO(b/135948230): Investigate why is the above statement not true and |
| 427 | // then get rid of the special case. |
| 428 | ctx->SetStatus(Status::OK()); |
| 429 | return; |
| 430 | } |
| 431 | ctx->SetStatus(s); |
| 432 | } |
| 433 | |
| 434 | namespace { |
| 435 |
nothing calls this directly
no test coverage detected