code: def compare_state_dicts(a, b):
      same = True
      same = same and (list(a.keys()) == list(b.keys()))
      if not same:
          return same
  
      for val1, val2 in zip(a.values(), b.values()):
          if isinstance(val1, torch.Tensor):
              same = same and compare_tensors(val1, val2)
          elif not isinstance(val2, torch.Tensor):
              same = same and val1 == val2
          else:
              same = False
          if not same:
              return same
  
      return same
  
imports: import argparse
  import contextlib
  import itertools
  import json
  import os
  import platform
  import random
  import socket
  import tempfile
  import unittest
  from dataclasses import dataclass
  from typing import Callable, Dict, List, Optional
  import torch
  from mmf.common.registry import registry
  from mmf.common.sample import Sample, SampleList
  from mmf.models.base_model import BaseModel
  from mmf.utils.general import get_current_device
  from omegaconf import OmegaConf
  from torch import Tensor
label_desc: Use image node_id 12 for calling a global function with example usage: compare_state_dicts(a, b) and returns: same, same, same