code: def _detect_anomaly(losses, loss_dict, iteration):
      if not torch.isfinite(losses).all():
          raise FloatingPointError(
              "Loss became infinite or NaN at iteration={}!\nloss_dict = {}".format(
                  iteration, loss_dict
              )
          )
  
file_path: gluon-cv/gluoncv/torch/utils/task_utils/pose.py
imports: import time
  import logging
  import datetime
  import numpy
  import torch
  from ..None import comm
  from ..utils import AverageMeter
  from ..model_utils import save_model
  from ..optimizer import maybe_add_gradient_clipping
  from ..eval_utils.coco_eval import COCOEvaluator
label_desc: Use image node_id 1 for calling a global function with example usage: _detect_anomaly(losses, loss_dict, iteration) without return types