code: def _has_inf_or_nan(x):
      inf_count = torch.sum(x.abs() == float("inf"))
      if inf_count > 0:
          return True
      nan_count = torch.sum(x != x)
      return nan_count > 0
  
file_path: DALI/docs/examples/use_cases/video_superres/common/loss_scaler.py
imports: import torch
label_desc: Use image node_id 3 for calling the DynamicLossScaler obj's underlying member method code with example usage: obj._has_inf_or_nan(x) and returns: unknown, True