Skip to content

Commit ac56b48

Browse files
authored
Fixed unused variables in ops (#4666)
* Fixed unused variables in ops * Fixed test failure
1 parent 341fca9 commit ac56b48

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

torchvision/ops/boxes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def masks_to_boxes(masks: torch.Tensor) -> torch.Tensor:
323323
bounding_boxes = torch.zeros((n, 4), device=masks.device, dtype=torch.float)
324324

325325
for index, mask in enumerate(masks):
326-
y, x = torch.where(masks[index] != 0)
326+
y, x = torch.where(mask != 0)
327327

328328
bounding_boxes[index, 0] = torch.min(x)
329329
bounding_boxes[index, 1] = torch.min(y)

torchvision/ops/deform_conv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def deform_conv2d(
7474
pad_h, pad_w = _pair(padding)
7575
dil_h, dil_w = _pair(dilation)
7676
weights_h, weights_w = weight.shape[-2:]
77-
_, n_in_channels, in_h, in_w = input.shape
77+
_, n_in_channels, _, _ = input.shape
7878

7979
n_offset_grps = offset.shape[1] // (2 * weights_h * weights_w)
8080
n_weight_grps = n_in_channels // weight.shape[1]

0 commit comments

Comments
 (0)