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

Method ComputeAsync

tensorflow/core/kernels/work_queue_ops.cc:310–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308 }
309
310 void ComputeAsync(OpKernelContext* ctx,
311 AsyncOpKernel::DoneCallback done) override {
312 WorkQueue* work_queue;
313 OP_REQUIRES_OK(ctx,
314 LookupResource(ctx, HandleFromInput(ctx, 0), &work_queue));
315 core::ScopedUnref scoped_list(work_queue);
316 work_queue->Schedule(num_clients_, [this, ctx, done, work_queue]() {
317 Tensor* work;
318 OP_REQUIRES_OK_ASYNC(ctx, ctx->allocate_output(0, TensorShape({}), &work),
319 done);
320 OP_REQUIRES_OK_ASYNC(ctx, work_queue->Take(work), done);
321 done();
322 });
323 }
324
325 private:
326 int64 num_clients_;

Callers

nothing calls this directly

Calls 6

LookupResourceFunction · 0.85
HandleFromInputFunction · 0.85
allocate_outputMethod · 0.80
TensorShapeClass · 0.50
ScheduleMethod · 0.45
TakeMethod · 0.45

Tested by

no test coverage detected