Relu means rectified linear function, i.e, y = max(0, x) is applied to the CTensors elementwise. Args: x (Tensor): input tensor. Returns: a new Tensor whose element y = x if x >= 0; otherwise 0.
(x)
| 440 | |
| 441 | |
| 442 | def relu(x): |
| 443 | """ |
| 444 | Relu means rectified linear function, i.e, y = max(0, x) is applied to the |
| 445 | CTensors elementwise. |
| 446 | Args: |
| 447 | x (Tensor): input tensor. |
| 448 | Returns: |
| 449 | a new Tensor whose element y = x if x >= 0; otherwise 0. |
| 450 | """ |
| 451 | return ReLU()(x)[0] |
| 452 | |
| 453 | |
| 454 | class Less(Operator): |