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

Method Compile

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

Source from the content-addressed store, hash-verified

113 OP_REQUIRES_OK(ctx, ctx->GetAttr("alpha", &alpha_));
114 }
115 void Compile(XlaOpKernelContext* ctx) override {
116 auto gradients = ctx->Input("gradients");
117 auto features = ctx->Input("features");
118 auto output =
119 xla::Select(xla::Gt(features, xla::ScalarLike(features, 0)), gradients,
120 gradients * xla::ScalarLike(gradients, alpha_));
121 ctx->SetOutput(0, output);
122 }
123 float alpha_;
124};
125REGISTER_XLA_OP(Name("LeakyReluGrad"), LeakyReluGradOp);

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected