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

Method ComputeAsync

tensorflow/core/kernels/barrier_ops.cc:532–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

530
531 protected:
532 void ComputeAsync(OpKernelContext* ctx, Barrier* barrier,
533 DoneCallback callback) override {
534 OP_REQUIRES_ASYNC(
535 ctx, component_index_ < barrier->num_components(),
536 errors::InvalidArgument("The component ID is out of range ",
537 component_index_, " > num_components",
538 " (= ", barrier->num_components(), ")"),
539 callback);
540 OP_REQUIRES_OK_ASYNC(
541 ctx,
542 ctx->MatchSignature({DT_STRING_REF, DT_STRING,
543 barrier->component_type(component_index_)},
544 {}),
545 callback);
546
547 const Tensor* keys;
548 const Tensor* values;
549 OP_REQUIRES_OK_ASYNC(ctx, ctx->input("keys", &keys), callback);
550 OP_REQUIRES_OK_ASYNC(ctx, ctx->input("values", &values), callback);
551 barrier->TryInsertMany<T>(*keys, component_index_, *values, ctx, callback);
552 }
553
554 private:
555 int component_index_;

Callers

nothing calls this directly

Calls 5

InvalidArgumentFunction · 0.85
MatchSignatureMethod · 0.80
component_typeMethod · 0.80
num_componentsMethod · 0.45
inputMethod · 0.45

Tested by

no test coverage detected