code: def _divide_no_nan(a, b):
      """
      a/b where the resulted NaN or Inf are replaced by 0.
      """
      result = a / b
      result[result != result] = 0.0
      result[result == np.inf] = 0.0
      result[result == np.NINF] = 0.0
      return result
  
file_path: darts/darts/utils/losses.py
imports: import numpy
  import torch
  import torch.nn
label_desc: Use image node_id 1 for calling a global function with example usage: _divide_no_nan(a, b) and returns: result