[Fix] Fix the discontiguous output feature map of ConvNeXt. (#743)

* [Fix] Fix the discontiguous output feature map of ConvNeXt.

* Add comment
pull/754/head
Ma Zerun 2022-03-25 12:34:44 +08:00 committed by GitHub
parent a19c28fe95
commit 1717efadbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -312,7 +312,9 @@ class ConvNeXt(BaseBackbone):
gap = x.mean([-2, -1], keepdim=True)
outs.append(norm_layer(gap).flatten(1))
else:
outs.append(norm_layer(x))
# The output of LayerNorm2d may be discontiguous, which
# may cause some problem in the downstream tasks
outs.append(norm_layer(x).contiguous())
return tuple(outs)