torch.nn.functional.gelu¶
- torch.nn.functional.gelu(input, approximate='none') Tensor¶
當 approximate 引數為 'none' 時,按元素應用以下函式
其中 是高斯分佈的累積分佈函式。
當 approximate 引數為 'tanh' 時,Gelu 透過以下公式近似計算:
參見 高斯誤差線性單元 (GELUs)。
當 approximate 引數為 'none' 時,按元素應用以下函式
其中 是高斯分佈的累積分佈函式。
當 approximate 引數為 'tanh' 時,Gelu 透過以下公式近似計算:
參見 高斯誤差線性單元 (GELUs)。