Skip to content

Commit

Permalink
Fix segfault in DeformConv2d when mask is None (#7632)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHug authored May 26, 2023
1 parent 4a51822 commit 81d12c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchvision/ops/deform_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def deform_conv2d(
use_mask = mask is not None

if mask is None:
mask = torch.zeros((input.shape[0], 0), device=input.device, dtype=input.dtype)
mask = torch.zeros((input.shape[0], 1), device=input.device, dtype=input.dtype)

if bias is None:
bias = torch.zeros(out_channels, device=input.device, dtype=input.dtype)
Expand Down

0 comments on commit 81d12c3

Please sign in to comment.