Method
__init__
(self, num_groups, num_channels, eps=1e-5)
Source from the content-addressed store, hash-verified
| 87 | |
| 88 | class GroupNorm(nn.Module): |
| 89 | def __init__(self, num_groups, num_channels, eps=1e-5): |
| 90 | super().__init__() |
| 91 | self.num_groups = num_groups |
| 92 | self.num_channels = num_channels |
| 93 | self.eps = eps |
| 94 | self.weight = nn.Parameter(torch.ones(num_channels)) |
| 95 | self.bias = nn.Parameter(torch.zeros(num_channels)) |
| 96 | |
| 97 | def forward(self, x): |
| 98 | N, C, H, W = x.shape |
Callers
nothing calls this directly
Tested by
no test coverage detected