On this page
torch.nn.functional.glu
torch.nn.functional.glu(input, dim=-1) → Tensor[source]-
The gated linear unit. Computes:
where
inputis split in half alongdimto formaandb, is the sigmoid function and is the element-wise product between matrices.
© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.nn.functional.glu.html