From 28fd05eeb68114aa8a8d915168bdf6e7f7b5c2a6 Mon Sep 17 00:00:00 2001
From: Leon Dong <leond@meta.com>
Date: Thu, 10 Oct 2024 17:47:26 -0700
Subject: [PATCH] Revert rotated boxes change

Summary: Previous change (D64119684) broke a test T204260403. This diff reverts the change and ensures that the detector model still works.

Reviewed By: srihari2761

Differential Revision: D64198984

fbshipit-source-id: eb4e509fd74dabe2bbb2bb39e3a45f06b9cfb71c
---
 detectron2/structures/rotated_boxes.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/detectron2/structures/rotated_boxes.py b/detectron2/structures/rotated_boxes.py
index 01a363fd5b..cb65e22036 100644
--- a/detectron2/structures/rotated_boxes.py
+++ b/detectron2/structures/rotated_boxes.py
@@ -1,6 +1,6 @@
 # Copyright (c) Facebook, Inc. and its affiliates.
 import math
-from typing import Any, List, Tuple
+from typing import List, Tuple
 import torch
 
 from detectron2.layers.rotated_boxes import pairwise_iou_rotated
@@ -229,9 +229,9 @@ def clone(self) -> "RotatedBoxes":
         """
         return RotatedBoxes(self.tensor.clone())
 
-    def to(self, device: torch.device, *args: Any, **kwargs: Any):
+    def to(self, device: torch.device, non_blocking: bool = False):
         # Boxes are assumed float32 and does not support to(dtype)
-        return RotatedBoxes(self.tensor.to(device=device))
+        return RotatedBoxes(self.tensor.to(device=device, non_blocking=non_blocking))
 
     def area(self) -> torch.Tensor:
         """