| 78 | using ReaderVerbAsyncOpKernel::ReaderVerbAsyncOpKernel; |
| 79 | |
| 80 | void ComputeWithReader(OpKernelContext* context, |
| 81 | ReaderInterface* reader) override { |
| 82 | QueueInterface* queue; |
| 83 | OP_REQUIRES_OK(context, |
| 84 | GetResourceFromContext(context, "queue_handle", &queue)); |
| 85 | core::ScopedUnref unref_me(queue); |
| 86 | Tensor* key = nullptr; |
| 87 | OP_REQUIRES_OK(context, |
| 88 | context->allocate_output("key", TensorShape({}), &key)); |
| 89 | Tensor* value = nullptr; |
| 90 | OP_REQUIRES_OK(context, |
| 91 | context->allocate_output("value", TensorShape({}), &value)); |
| 92 | |
| 93 | auto key_scalar = key->scalar<string>(); |
| 94 | auto value_scalar = value->scalar<string>(); |
| 95 | reader->Read(queue, &key_scalar(), &value_scalar(), context); |
| 96 | } |
| 97 | }; |
| 98 | |
| 99 | REGISTER_KERNEL_BUILDER(Name("ReaderRead").Device(DEVICE_CPU), ReaderReadOp); |
nothing calls this directly
no test coverage detected