MCPcopy Create free account
hub / github.com/alibaba/euler / GetSparseFeature

Method GetSparseFeature

tf_euler/kernels/get_sparse_feature_op.cc:32–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30class GetSparseFeature: public AsyncOpKernel {
31 public:
32 explicit GetSparseFeature(OpKernelConstruction* ctx): AsyncOpKernel(ctx) {
33 OP_REQUIRES_OK(ctx, ctx->GetAttr("feature_names", &feature_names_));
34 OP_REQUIRES_OK(ctx, ctx->GetAttr("default_values", &default_values_));
35 OP_REQUIRES_OK(ctx, ctx->GetAttr("N", &N_));
36 OP_REQUIRES(ctx, default_values_.size() == feature_names_.size(),
37 errors::InvalidArgument(
38 "Require default_values.size() == feature_names_.size()"));
39 OP_REQUIRES(ctx, static_cast<size_t>(N_) == feature_names_.size(),
40 errors::InvalidArgument("Require N == feature_names.size"));
41 }
42
43 void ComputeAsync(OpKernelContext* ctx, DoneCallback done) override;
44

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected