r"""Element-wise `x * relu6(x + 3) / 6`. Example: >>> import numpy as np >>> x = Tensor(np.arange(5).astype(np.float32)) >>> out = F.hswish(x) >>> out.numpy().round(decimals=4) array([0. , 0.6667, 1.6667, 3. , 4. ], dtype=float32)
(x)
| 836 | |
| 837 | |
| 838 | def hswish(x): |
| 839 | r"""Element-wise `x * relu6(x + 3) / 6`. |
| 840 | |
| 841 | Example: |
| 842 | >>> import numpy as np |
| 843 | >>> x = Tensor(np.arange(5).astype(np.float32)) |
| 844 | >>> out = F.hswish(x) |
| 845 | >>> out.numpy().round(decimals=4) |
| 846 | array([0. , 0.6667, 1.6667, 3. , 4. ], dtype=float32) |
| 847 | """ |
| 848 | return _elwise(x, mode=Elemwise.Mode.H_SWISH) |
| 849 | |
| 850 | |
| 851 | def sigmoid(x): |