Skip to content

Commit 738a9cd

Browse files
committed
unbiased=False for torch.var_mean path of ConvNeXt LN. Fix #1090
1 parent e0c4eec commit 738a9cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

timm/models/convnext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def forward(self, x) -> torch.Tensor:
9494
return F.layer_norm(
9595
x.permute(0, 2, 3, 1), self.normalized_shape, self.weight, self.bias, self.eps).permute(0, 3, 1, 2)
9696
else:
97-
s, u = torch.var_mean(x, dim=1, keepdim=True)
97+
s, u = torch.var_mean(x, dim=1, unbiased=False, keepdim=True)
9898
x = (x - u) * torch.rsqrt(s + self.eps)
9999
x = x * self.weight[:, None, None] + self.bias[:, None, None]
100100
return x

0 commit comments

Comments
 (0)