code: def check_nan(array):
      tmp = np.sum(array)
      if np.isnan(tmp) or np.isinf(tmp):
          logger.warning("NaN or Inf found in input tensor.")
      return array
  
file_path: tensorboardX/tensorboardX/x2num.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: check_nan(array) and returns: array