Skip to content

Commit 0ff4716

Browse files
Remove double lines for casting
1 parent 7c04dba commit 0ff4716

File tree

1 file changed

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

1 file changed

+0
-2
lines changed

torchvision/transforms/v2/functional/_meta.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,6 @@ def _xyxyxyxy_to_xywhr(xyxyxyxy: torch.Tensor, inplace: bool) -> torch.Tensor:
256256
if need_cast:
257257
# Up-case to avoid overflow for square operations
258258
xyxyxyxy = xyxyxyxy.to(torch.float32)
259-
if need_cast:
260-
xyxyxyxy = xyxyxyxy.float()
261259

262260
r_rad = torch.atan2(xyxyxyxy[..., 1].sub(xyxyxyxy[..., 3]), xyxyxyxy[..., 2].sub(xyxyxyxy[..., 0]))
263261
# x1, y1, (x2 - x1), (y2 - y1), (x3 - x2), (y3 - y2) x4, y4

0 commit comments

Comments
 (0)