Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions torchvision/ops/giou_loss.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import torch
from torch import Tensor

from ..utils import _log_api_usage_once


def _upcast(t: Tensor) -> Tensor:
# Protects from numerical overflows in multiplications by upcasting to the equivalent higher type
Expand Down Expand Up @@ -41,6 +43,8 @@ def generalized_box_iou_loss(
A Metric and A Loss for Bounding Box Regression:
https://arxiv.org/abs/1902.09630
"""
if not torch.jit.is_scripting() and not torch.jit.is_tracing():
_log_api_usage_once(generalized_box_iou_loss)

boxes1 = _upcast(boxes1)
boxes2 = _upcast(boxes2)
Expand Down