MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ComputeAsync

Method ComputeAsync

tensorflow/core/kernels/batch_kernels.cc:814–834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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_'.

Callers

nothing calls this directly

Calls 7

New64Function · 0.85
RegisterInputMethod · 0.80
CreateFunction · 0.70
releaseMethod · 0.45
LookupOrCreateMethod · 0.45
resource_managerMethod · 0.45
UnrefMethod · 0.45

Tested by

no test coverage detected