Skip to content

Commit

Permalink
[Fix] Fix the bug when input mask is not '0-1-tensor' in masked_conv (o…
Browse files Browse the repository at this point in the history
  • Loading branch information
ckirchhoff2021 committed Dec 21, 2022
1 parent 2e92c88 commit 5ee553b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mmcv/ops/masked_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def forward(ctx,
if mask.size()[1:] != output.size()[2:]:
raise ValueError(
'The mask is inconsistent with the shape of output_conv.')
mask = mask > 0
mask = mask.type(output.dtype)
output = output * mask
return output

Expand Down

0 comments on commit 5ee553b

Please sign in to comment.