Clamp the scalar input between 0 and 6.
| 50 | explicit Relu6Op(OpKernelConstruction* ctx) : XlaOpKernel(ctx) {} |
| 51 | // Clamp the scalar input between 0 and 6. |
| 52 | void Compile(XlaOpKernelContext* ctx) override { |
| 53 | ctx->SetOutput(0, xla::Relu6(ctx->Input(0))); |
| 54 | } |
| 55 | }; |
| 56 | REGISTER_XLA_OP(Name("Relu6"), Relu6Op); |
| 57 |