Skip to content

Commit

Permalink
[Fix] Fix performance issue in convnext DDP train. (#1098)
Browse files Browse the repository at this point in the history
to fix performance issue in convnext DDP train
  • Loading branch information
cybergeek2077 authored Oct 17, 2022
1 parent bcadb74 commit 38040d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mmcls/models/backbones/convnext.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def forward(self, x):
assert x.dim() == 4, 'LayerNorm2d only supports inputs with shape ' \
f'(N, C, H, W), but got tensor with shape {x.shape}'
return F.layer_norm(
x.permute(0, 2, 3, 1), self.normalized_shape, self.weight,
self.bias, self.eps).permute(0, 3, 1, 2)
x.permute(0, 2, 3, 1).contiguous(), self.normalized_shape,
self.weight, self.bias, self.eps).permute(0, 3, 1, 2).contiguous()


class ConvNeXtBlock(BaseModule):
Expand Down

0 comments on commit 38040d5

Please # to comment.