code: def custom_equals(item, other) -> bool:
      """
      Helper function allowing to test if two items are equal.
      The function is called recursively if the items are lists or tuples and
       it uses `torch.equal` if the two items to compare are Tensors.
      """
      if type(item) != type(other):
          return False
      if isinstance(item, (tuple, list)):
          if len(item) != len(other):
              return False
          return all(custom_equals(*elts) for elts in zip(item, other))
      if isinstance(item, torch.Tensor):
          return torch.equal(item, other)
      return item == other
  
file_path: avalanche/tests/benchmarks/classic/test_ctrl.py
imports: import unittest
  from pathlib import Path
  from tempfile import TemporaryDirectory
  import torch
  from tests.unit_tests_utils import FAST_TEST, is_github_action
label_desc: Use image node_id 1 for calling a global function with example usage: custom_equals(item, other) and returns: unknown, False, all, torch, False