Given an input value x, it computes Rectified Linear 6: min(max(x, 0), 6). Args: x: A variable. Returns: output: A variable with the same type as `x`. */
| 445 | output: A variable with the same type as `x`. |
| 446 | */ |
| 447 | VARP _Relu6(VARP x, float minValue, float maxValue) { |
| 448 | std::unique_ptr<OpT> relu(new OpT); |
| 449 | relu->type = OpType_ReLU6; |
| 450 | relu->main.value = new Relu6T; |
| 451 | relu->main.type = OpParameter_Relu6; |
| 452 | relu->main.AsRelu6()->maxValue = maxValue; |
| 453 | relu->main.AsRelu6()->minValue = minValue; |
| 454 | return (Variable::create(Expr::create(relu.get(), {x}))); |
| 455 | } |
| 456 | /*Given an input value x, it computes the output as x if x > 0 and slopes * x if x <= 0. |
| 457 | Args: |
| 458 | x: A variable, must be 4-D with NC4HW4 format. |