| 272 | explicit WorkQueueSizeOp(OpKernelConstruction* ctx) : OpKernel(ctx) {} |
| 273 | |
| 274 | void Compute(OpKernelContext* ctx) override { |
| 275 | WorkQueue* work_queue; |
| 276 | OP_REQUIRES_OK(ctx, |
| 277 | LookupResource(ctx, HandleFromInput(ctx, 0), &work_queue)); |
| 278 | Tensor* size; |
| 279 | OP_REQUIRES_OK(ctx, ctx->allocate_output(0, TensorShape({}), &size)); |
| 280 | OP_REQUIRES_OK(ctx, work_queue->GetSize(size)); |
| 281 | } |
| 282 | }; |
| 283 | |
| 284 | REGISTER_KERNEL_BUILDER(Name("WorkQueueSize").Device(DEVICE_CPU), |
nothing calls this directly
no test coverage detected