code: def allclose_with_out(x, y, atol=0.0, rtol=1.0e-5):
      # run the np.allclose on x and y
      # if it fails print some stats
      # before returning
      ac = np.allclose(x, y, rtol=rtol, atol=atol)
      if not ac:
          dd = np.abs(x - y)
          neon_logger.display(
              "abs errors: %e [%e, %e] Abs Thresh = %e"
              % (np.median(dd), np.min(dd), np.max(dd), atol)
          )
          amax = np.argmax(dd)
  
          if np.isscalar(x):
              neon_logger.display(
                  "worst case: %e %e" % (x, y.flat[amax])
              )
          elif np.isscalar(y):
              neon_logger.display(
                  "worst case: %e %e" % (x.flat[amax], y)
              )
          else:
              neon_logger.display(
                  "worst case: %e %e" % (x.flat[amax], y.flat[amax])
              )
  
          dd = np.abs(dd - atol) / np.abs(y)
          neon_logger.display(
              "rel errors: %e [%e, %e] Rel Thresh = %e"
              % (np.median(dd), np.min(dd), np.max(dd), rtol)
          )
          amax = np.argmax(dd)
          if np.isscalar(x):
              neon_logger.display(
                  "worst case: %e %e" % (x, y.flat[amax])
              )
          elif np.isscalar(y):
              neon_logger.display(
                  "worst case: %e %e" % (x.flat[amax], y)
              )
          else:
              neon_logger.display(
                  "worst case: %e %e" % (x.flat[amax], y.flat[amax])
              )
      return ac
  
file_path: neon/tests/utils.py
imports: from builtins import zip
  import numpy
  import numpy.random
  from neon import logger
  from neon.backends.backend import Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: allclose_with_out(x, y, atol, rtol) and returns: ac