| 399 | } |
| 400 | |
| 401 | void MakeIteratorOp::ComputeAsync(OpKernelContext* ctx, DoneCallback done) { |
| 402 | DatasetBase* dataset; |
| 403 | OP_REQUIRES_OK(ctx, GetDatasetFromVariantTensor(ctx->input(0), &dataset)); |
| 404 | IteratorResource* iterator_resource; |
| 405 | OP_REQUIRES_OK( |
| 406 | ctx, LookupResource(ctx, HandleFromInput(ctx, 1), &iterator_resource)); |
| 407 | background_worker_.Schedule(std::bind( |
| 408 | [ctx, iterator_resource, dataset](DoneCallback done) { |
| 409 | Status s = iterator_resource->SetIteratorFromDataset(ctx, dataset); |
| 410 | iterator_resource->Unref(); |
| 411 | if (!s.ok()) { |
| 412 | ctx->SetStatus(s); |
| 413 | } |
| 414 | done(); |
| 415 | }, |
| 416 | std::move(done))); |
| 417 | } |
| 418 | |
| 419 | void DeleteIteratorOp::Compute(OpKernelContext* ctx) { |
| 420 | ResourceHandle handle = ctx->input(0).flat<ResourceHandle>()(0); |
nothing calls this directly
no test coverage detected