def METHOD_NAME(self, device="cpu"):
    N = 1000
    boxes, scores = self._create_tensors(N, device=device)
    rotated_boxes = torch.zeros(N, 5, device=device)
    rotated_boxes[:, 0] = (boxes[:, 0] + boxes[:, 2]) / 2.0
    rotated_boxes[:, 1] = (boxes[:, 1] + boxes[:, 3]) / 2.0
    rotated_boxes[:, 2] = boxes[:, 2] - boxes[:, 0]
    rotated_boxes[:, 3] = boxes[:, 3] - boxes[:, 1]
    err_msg = "Rotated NMS incompatible between CPU and reference implementation for IoU={}"
    for iou in [0.2, 0.5, 0.8]:
        keep_ref = self.reference_horizontal_nms(boxes, scores, iou)
        keep = nms_rotated(rotated_boxes, scores, iou)
        self.assertLessEqual(nms_edit_distance(keep, keep_ref), 1, err_msg.format(iou))