MCPcopy Index your code
hub / github.com/NVIDIA/TensorRT-LLM / silu

Function silu

tensorrt_llm/functional.py:827–838  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

825
826
827def 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
841def swiglu(input: Tensor) -> Tensor:

Callers 8

_beam_search_candidatesFunction · 0.90
forwardMethod · 0.90
swigluFunction · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
forwardMethod · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by 1