Skip to content

Commit 06047ef

Browse files
committed
fix(modules): use reshape instead of view in bcn
1 parent ff8ffac commit 06047ef

File tree

1 file changed

+3
-3
lines changed
  • cellseg_models_pytorch/modules/norm

1 file changed

+3
-3
lines changed

cellseg_models_pytorch/modules/norm/bcn.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ def __init__(
4747
def forward(self, x: torch.Tensor) -> torch.Tensor:
4848
"""Batch-channel norm forward pass."""
4949
out = self.bn(x)
50-
out = out.view(1, x.size(0) * self.num_groups, -1)
50+
out = out.reshape(1, x.size(0) * self.num_groups, -1)
5151
out = torch.batch_norm(out, None, None, None, None, True, 0, self.eps, True)
52-
out = out.view(x.size(0), self.num_groups, -1)
52+
out = out.reshape(x.size(0), self.num_groups, -1)
5353
out = self.weight * out + self.bias
54-
out = out.view_as(x)
54+
out = out.reshape_as(x)
5555

5656
return out

0 commit comments

Comments
 (0)