Skip to content

Commit

Permalink
Speedup Segformer decoder (#998)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhou0208 authored Dec 6, 2024
1 parent 05b48d5 commit 5a1a8f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion segmentation_models_pytorch/decoders/segformer/decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def forward(self, x: torch.Tensor):
batch, _, height, width = x.shape
x = x.flatten(2).transpose(1, 2)
x = self.linear(x)
x = x.transpose(1, 2).reshape(batch, -1, height, width).contiguous()
x = x.transpose(1, 2).reshape(batch, -1, height, width)
return x


Expand Down

0 comments on commit 5a1a8f1

Please sign in to comment.