GLU
- class torch.nn.GLU(dim=-1)
Applies the gated linear unit function.
where is the first half of the input matrices and is the second half.
Applies the gated linear unit function.
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
Examples:
>>> m = nn.GLU()
>>> input = torch.randn(4, 2)
>>> output = m(input)
Return the extra representation of the module.
Runs the forward pass.