Skip to content

Commit 26cf83f

Browse files
committed
Botched the merge
1 parent 3a8723e commit 26cf83f

File tree

1 file changed

+2
-2
lines changed
  • torchvision/transforms/v2/functional

1 file changed

+2
-2
lines changed

torchvision/transforms/v2/functional/_meta.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def _clamp_y_intercept(
479479
b1 = b2.clamp(b1, b3).clamp(0, canvas_size[0])
480480
b4 = b3.clamp(b2, b4).clamp(0, canvas_size[0])
481481

482-
if clamping_mode == "hard":
482+
if clamping_mode is not None and clamping_mode == "hard":
483483
# Hard clamping: Average b1 and b4, and adjust b2 and b3 for maximum area
484484
b1 = b4 = (b1 + b4) / 2
485485

@@ -574,7 +574,7 @@ def _clamp_along_y_axis(
574574
[case_a, case_b, case_c],
575575
):
576576
bounding_boxes = torch.where(cond.unsqueeze(1).repeat(1, 8), case.reshape(-1, 8), bounding_boxes)
577-
if clamping_mode == "hard":
577+
if clamping_mode is not None and clamping_mode == "hard":
578578
bounding_boxes[..., 0].clamp_(0) # Clamp x1 to 0
579579

580580
if need_cast:

0 commit comments

Comments
 (0)