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

Method Compute

tensorflow/core/kernels/lookup_table_op.h:52–74  ·  view source on GitHub ↗

ctx is not owned by this function.

Source from the content-addressed store, hash-verified

50
51 // ctx is not owned by this function.
52 void Compute(OpKernelContext* ctx) override {
53 mutex_lock l(mu_);
54
55 if (!table_handle_set_) {
56 OP_REQUIRES_OK(ctx, cinfo_.Init(ctx->resource_manager(), def(),
57 use_node_name_sharing_));
58 }
59
60 auto creator =
61 [ctx, this](lookup::LookupInterface** ret)
62 EXCLUSIVE_LOCKS_REQUIRED(mu_) {
63 lookup::LookupInterface* container = new Container(ctx, this);
64 if (!ctx->status().ok()) {
65 container->Unref();
66 return ctx->status();
67 }
68 if (ctx->track_allocations()) {
69 ctx->record_persistent_memory_allocation(
70 container->MemoryUsed() + table_handle_.AllocatedBytes());
71 }
72 *ret = container;
73 return Status::OK();
74 };
75
76 lookup::LookupInterface* table = nullptr;
77 OP_REQUIRES_OK(ctx,

Callers

nothing calls this directly

Calls 10

track_allocationsMethod · 0.80
EXCLUSIVE_LOCKS_REQUIREDFunction · 0.50
InitMethod · 0.45
resource_managerMethod · 0.45
okMethod · 0.45
statusMethod · 0.45
UnrefMethod · 0.45
MemoryUsedMethod · 0.45
AllocatedBytesMethod · 0.45

Tested by

no test coverage detected