Skip to content

Commit 805f33f

Browse files
committed
docs: add Examples section to GEGLU docstring
Add example showing usage of GEGLU to align docstring style with other activation classes. No functional changes.
1 parent 51126f9 commit 805f33f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

monai/networks/blocks/activation.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,14 @@ class GEGLU(nn.Module):
177177
Shape:
178178
- Input: :math:`(N, *, 2 * D)`
179179
- Output: :math:`(N, *, D)`, where `*` means, any number of additional dimensions
180+
181+
Examples::
182+
183+
>>> import torch
184+
>>> from monai.networks.layers.factories import Act
185+
>>> m = Act['geglu']()
186+
>>> input = torch.randn(2, 8) # last dim must be even
187+
>>> output = m(input)
180188
"""
181189

182190
def forward(self, input: torch.Tensor):

0 commit comments

Comments
 (0)