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)