code: def torch_allclose(x, y, rtol=1.0e-5, atol=1.0e-8):
      """
      Wrap on numpy's allclose. Input x and y are both tensors of equal shape
  
      Original numpy documentation:
      https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.allclose.html
  
      Notes:
      If the following equation is element-wise True, then allclose returns
      True.
  
       absolute(`a` - `b`) <= (`atol` + `rtol` * absolute(`b`))
  
      :param x: (torch tensor)
      :param y: (torch tensor)
      :param rtol: (float) the relative tolerance parameter
      :param atol: (float) the absolute tolerance parameter
      :return: (bool) if x and y are all close
      """
      import numpy as np
  
      return np.allclose(
          x.detach().cpu().numpy(),
          y.detach().cpu().numpy(),
          rtol=rtol,
          atol=atol,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 for calling a global function with example usage: torch_allclose(x, y, rtol, atol) and returns: np