Skip to content

Commit

Permalink
Merge pull request #757 from jaswanthbjk/inplace_fix
Browse files Browse the repository at this point in the history
fix for issue #741
  • Loading branch information
CCInc committed Jun 19, 2022
2 parents 297f0e0 + b2a32b0 commit 66e8bf2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
16 changes: 8 additions & 8 deletions torch_points3d/modules/MinkowskiEngine/api_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ def __init__(self, input_nc, output_nc, convolution, dimension=3):
def forward(self, x):
out = self.block(x)
if self.downsample:
out += self.downsample(x)
out = out + self.downsample(x)
else:
out += x
out = out + x
return out


Expand Down Expand Up @@ -153,9 +153,9 @@ def __init__(self, input_nc, output_nc, convolution, dimension=3, reduction=4):
def forward(self, x):
out = self.block(x)
if self.downsample:
out += self.downsample(x)
out = out + self.downsample(x)
else:
out += x
out = out + x
return out


Expand Down Expand Up @@ -204,9 +204,9 @@ def forward(self, x):
out = self.block(x)
out = self.SE(out)
if self.downsample:
out += self.downsample(x)
out = out + self.downsample(x)
else:
out += x
out = out + x
return out


Expand All @@ -223,9 +223,9 @@ def forward(self, x):
out = self.block(x)
out = self.SE(out)
if self.downsample:
out += self.downsample(x)
out = out + self.downsample(x)
else:
out += x
out = out + x
return out


Expand Down
8 changes: 4 additions & 4 deletions torch_points3d/modules/MinkowskiEngine/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def forward(self, x):
if self.downsample is not None:
residual = self.downsample(x)

out += residual
out = out + residual
out = self.relu(out)

return out
Expand Down Expand Up @@ -96,7 +96,7 @@ def forward(self, x):
if self.downsample is not None:
residual = self.downsample(x)

out += residual
out = out + residual
out = self.relu(out)

return out
Expand Down Expand Up @@ -315,7 +315,7 @@ def forward(self, x):
if self.downsample is not None:
residual = self.downsample(x)

out += residual
out = out + residual
out = self.relu(out)

return out
Expand Down Expand Up @@ -360,7 +360,7 @@ def forward(self, x):
if self.downsample is not None:
residual = self.downsample(x)

out += residual
out = out + residual
out = self.relu(out)

return out
Expand Down
4 changes: 2 additions & 2 deletions torch_points3d/modules/MinkowskiEngine/res16unet.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def forward(self, x):
if self.downsample is not None:
residual = self.downsample(x)

out += residual
out = out + residual
out = self.relu(out)

return out
Expand Down Expand Up @@ -109,7 +109,7 @@ def forward(self, x):
if self.downsample is not None:
residual = self.downsample(x)

out += residual
out = out + residual
out = self.relu(out)

return out
Expand Down
2 changes: 1 addition & 1 deletion torch_points3d/modules/PPNet/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def forward(self, data, precomputed=None, **kwargs):
shortcut_x = torch.max(neighborhood_features, dim=1, keepdim=False)[0]

shortcut = self.shortcut_op(shortcut_x)
output.x += shortcut
output.x = output.x + shortcut
output.x = self.activation(output.x)
return output

Expand Down
8 changes: 4 additions & 4 deletions torch_points3d/modules/SparseConv3d/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def __init__(self, input_nc, output_nc, convolution):
def forward(self, x):
out = self.block(x)
if self.downsample:
out += self.downsample(x)
out = out + self.downsample(x)
else:
out += x
out = out + x
return out


Expand Down Expand Up @@ -94,9 +94,9 @@ def __init__(self, input_nc, output_nc, convolution, reduction=4):
def forward(self, x):
out = self.block(x)
if self.downsample:
out += self.downsample(x)
out = out + self.downsample(x)
else:
out += x
out = out + x
return out


Expand Down

0 comments on commit 66e8bf2

Please sign in to comment.