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

Method Compute

tensorflow/core/kernels/lookup_table_op.cc:893–901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

891 explicit LookupTableSizeOp(OpKernelConstruction* ctx) : OpKernel(ctx) {}
892
893 void Compute(OpKernelContext* ctx) override {
894 lookup::LookupInterface* table;
895 OP_REQUIRES_OK(ctx, GetLookupTable("table_handle", ctx, &table));
896 core::ScopedUnref unref_me(table);
897
898 Tensor* out;
899 OP_REQUIRES_OK(ctx, ctx->allocate_output("size", TensorShape({}), &out));
900 out->flat<int64>().setConstant(table->size());
901 }
902};
903
904REGISTER_KERNEL_BUILDER(Name("LookupTableSize").Device(DEVICE_CPU),

Callers

nothing calls this directly

Calls 4

GetLookupTableFunction · 0.85
allocate_outputMethod · 0.80
TensorShapeClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected