Add a SiLU (`x * sigmoid(x)`) operation. Parameters: input : Tensor The input tensor on which the activation function is applied. Returns: The tensor produced by the activation layer.
(input: Tensor)
| 825 | |
| 826 | |
| 827 | def silu(input: Tensor) -> Tensor: |
| 828 | ''' |
| 829 | Add a SiLU (`x * sigmoid(x)`) operation. |
| 830 | |
| 831 | Parameters: |
| 832 | input : Tensor |
| 833 | The input tensor on which the activation function is applied. |
| 834 | |
| 835 | Returns: |
| 836 | The tensor produced by the activation layer. |
| 837 | ''' |
| 838 | return input * sigmoid(input) |
| 839 | |
| 840 | |
| 841 | def swiglu(input: Tensor) -> Tensor: |
no outgoing calls