code: def compare_batches(test_fixture, batch1, batch2):
      """Compare two batches. Does not do recursive comparison"""
      test_fixture.assertEqual(type(batch1), type(batch2))
      if isinstance(batch1, (tuple, list)):
          test_fixture.assertEqual(len(batch1), len(batch2))
          for n in range(len(batch1)):
              value1 = batch1[n]
              value2 = batch2[n]
              test_fixture.assertEqual(type(value1), type(value2))
              if torch.is_tensor(value1):
                  test_fixture.assertTrue(
                      torch.allclose(value1, value2)
                  )
              else:
                  test_fixture.assertEqual(value1, value2)
  
      elif isinstance(batch1, dict):
          test_fixture.assertEqual(batch1.keys(), batch2.keys())
          for key, value1 in batch1.items():
              value2 = batch2[key]
              test_fixture.assertEqual(type(value1), type(value2))
              if torch.is_tensor(value1):
                  test_fixture.assertTrue(
                      torch.allclose(value1, value2)
                  )
              else:
                  test_fixture.assertEqual(value1, value2)
  
imports: import os
  import unittest
  from functools import wraps
  import torch
  from classy_vision.hooks import ClassyHook
  from classy_vision.tasks import ClassyTask
  from classy_vision.trainer import ClassyTrainer
label_desc: Use image node_id 4 for calling a global function with example usage: compare_batches(test_fixture, batch1, batch2) without return types