code: def test_GNN_load_from_pretrained():
      from deepchem.models.torch_models.gnn import GNNModular
  
      dataset, _ = get_regression_dataset()
      model = GNNModular(task="edge_pred")
      model.fit(dataset, nb_epoch=1)
      model2 = GNNModular(task="edge_pred")
      model2.load_from_pretrained(model_dir=model.model_dir)
      assert model.components.keys() == model2.components.keys()
      keys_with_weights = [
          key
          for key in model.components.keys()
          if hasattr(model.components[key], "weight")
      ]
      assert all(
          compare_weights(key, model, model2)
          for key in keys_with_weights
      )
  
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 5 for calling a global function with example usage: test_GNN_load_from_pretrained() without return types