Rate this Page
★★★★★
GLU#
- classtorch.nn.GLU(dim=-1)[source]#
Applies the gated linear unit function.
where is the first halfof the input matrices and is the second half.
- Parameters
dim (int) – the dimension on which to split the input. Default: -1
- Shape:
Input: where* means, any number of additionaldimensions
Output: where

Examples:
>>>m=nn.GLU()>>>input=torch.randn(4,2)>>>output=m(input)
On this page