code: def compare_weights(key, model1, model2):
      import torch
  
      return torch.all(
          torch.eq(
              model1.components[key].weight,
              model2.components[key].weight,
          )
      ).item()
  
file_path: deepchem/deepchem/models/tests/test_gnn.py
imports: import os
  import pytest
  import numpy
  import deepchem
  from deepchem.feat.molecule_featurizers import SNAPFeaturizer
label_desc: Use image node_id 2 for calling a global function with example usage: compare_weights(key, model1, model2) and returns: torch