GLU#
- class torch.nn.modules.activation.GLU(dim=-1)[源代码]#
应用门控线性单元函数。
where is the first half of the input matrices and is the second half.
- 参数
dim (int) – the dimension on which to split the input. Default: -1
- 形状
Input: where * means, any number of additional dimensions
Output: where
示例
>>> m = nn.GLU() >>> input = torch.randn(4, 2) >>> output = m(input)