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

Method Compile

tensorflow/compiler/tf2xla/kernels/relu_op.cc:63–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 OP_REQUIRES_OK(ctx, ctx->GetAttr("alpha", &alpha_));
62 }
63 void Compile(XlaOpKernelContext* ctx) override {
64 auto features = ctx->Input("features");
65 auto prod_with_alpha = features * xla::ScalarLike(features, alpha_);
66 auto gt_zero = xla::Gt(features, xla::ScalarLike(features, 0));
67 auto output = xla::Select(gt_zero, features, prod_with_alpha);
68 ctx->SetOutput(0, output);
69 }
70 float alpha_;
71};
72REGISTER_XLA_OP(Name("LeakyRelu"), LeakyReluOp);

Callers

nothing calls this directly

Calls 5

ScalarLikeFunction · 0.85
GtClass · 0.50
SelectFunction · 0.50
InputMethod · 0.45
SetOutputMethod · 0.45

Tested by

no test coverage detected