| 812 | } |
| 813 | |
| 814 | void ComputeAsync(OpKernelContext* c, DoneCallback done) final { |
| 815 | BatchResource* br; |
| 816 | std::function<Status(BatchResource**)> creator = [this](BatchResource** r) { |
| 817 | std::unique_ptr<BatchResource> new_resource; |
| 818 | TF_RETURN_IF_ERROR(BatchResource::Create( |
| 819 | num_batch_threads_, max_batch_size_, batch_timeout_micros_, |
| 820 | max_enqueued_batches_, allowed_batch_sizes_, kInvalidHandle, |
| 821 | &new_resource)); |
| 822 | *r = new_resource.release(); |
| 823 | return Status::OK(); |
| 824 | }; |
| 825 | OP_REQUIRES_OK_ASYNC(c, |
| 826 | c->resource_manager()->LookupOrCreate( |
| 827 | container_, shared_name_, &br, creator), |
| 828 | done); |
| 829 | const Status status = |
| 830 | br->RegisterInput(random::New64(), c, batcher_queue_, done); |
| 831 | br->Unref(); |
| 832 | OP_REQUIRES_OK_ASYNC(c, status, done); |
| 833 | // Assume br calls done, so nothing to do here. |
| 834 | } |
| 835 | |
| 836 | // Validates 'allowed_batch_sizes_'. The entries must increase monotonically, |
| 837 | // and the last one must equal 'max_batch_size_'. |
nothing calls this directly
no test coverage detected