From 3aee95ff7c0868c1daf768eaedce30958443d5b2 Mon Sep 17 00:00:00 2001 From: Vasilis Vryniotis Date: Mon, 28 Mar 2022 09:25:09 +0100 Subject: [PATCH] Adding log call on giou loss --- torchvision/ops/giou_loss.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/torchvision/ops/giou_loss.py b/torchvision/ops/giou_loss.py index bce7d046780..c43a788063e 100644 --- a/torchvision/ops/giou_loss.py +++ b/torchvision/ops/giou_loss.py @@ -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 @@ -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)