Unverified Commit 818dc22f authored by Vasilis Vryniotis's avatar Vasilis Vryniotis Committed by GitHub
Browse files

Adding log call on giou loss (#5690)

parent 0cba9b78
import torch import torch
from torch import Tensor from torch import Tensor
from ..utils import _log_api_usage_once
def _upcast(t: Tensor) -> Tensor: def _upcast(t: Tensor) -> Tensor:
# Protects from numerical overflows in multiplications by upcasting to the equivalent higher type # Protects from numerical overflows in multiplications by upcasting to the equivalent higher type
...@@ -41,6 +43,8 @@ def generalized_box_iou_loss( ...@@ -41,6 +43,8 @@ def generalized_box_iou_loss(
A Metric and A Loss for Bounding Box Regression: A Metric and A Loss for Bounding Box Regression:
https://arxiv.org/abs/1902.09630 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) boxes1 = _upcast(boxes1)
boxes2 = _upcast(boxes2) boxes2 = _upcast(boxes2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment