docstr: tlist1 and tlist2 are list of torch.tensor.
docstr_tok: ["tlist1","and","tlist2","are","list","of","torch.tensor","."]
code: def assert_allclose(self, tlist1, tlist2, rtol, atol):
      """
      tlist1 and tlist2 are list of torch.tensor.
      """
      passed = True
      assert len(tlist1) == len(tlist2)
      for i in range(len(tlist1)):
  
          def convert_tensor(obj):
              if torch.is_tensor(obj):
                  return obj
              return torch.from_numpy(obj)
  
          t1 = convert_tensor(tlist1[i])
          t2 = convert_tensor(tlist2[i])
  
          # fast allclose
          res = torch.allclose(
              t1.flatten(),
              t2.flatten(),
              rtol=rtol,
              atol=atol,
              equal_nan=False,
          )
          if res:
              continue
          passed = False
          print(
              "torch.allclose failed, use numpy.allclose to log detail."
          )
          t1 = t1.cpu().numpy().flatten()
          t2 = t2.cpu().numpy().flatten()
          try:
              diff_mask = np.isclose(t1, t2, rtol=rtol, atol=atol)
              print("Unmatched x:", t1[~diff_mask])
              print("Unmatched y:", t2[~diff_mask])
              np.testing.assert_allclose(
                  t1,
                  t2,
                  rtol=rtol,
                  atol=atol,
                  verbose=True,
                  equal_nan=False,
              )
          except Exception as ex:
              print(f"Unmatches in the {i}-th tensor.")
              print(ex)
              continue
      if not passed:
          exit(0)
  
imports: import random
  import time
  from collections import OrderedDict
  import numpy
  import torch
label_desc: Use image node_id 24 for calling the TestDecorator obj's underlying member method code with example usage: obj.assert_allclose(tlist1, tlist2, rtol, atol) and returns: torch, obj