code: def test_packaging():
      if (
          not torch_geometric.typing.WITH_PT113
          and sys.version_info.major == 3
          and sys.version_info.minor >= 10
      ):
          return  # Unsupported Python version
  
      warnings.filterwarnings(
          "ignore", ".*TypedStorage is deprecated.*"
      )
  
      os.makedirs(torch.hub._get_torch_home(), exist_ok=True)
  
      x = torch.randn(3, 8)
      edge_index = torch.tensor([[0, 1, 1, 2], [1, 0, 2, 1]])
  
      model = GraphSAGE(8, 16, num_layers=3)
      path = osp.join(torch.hub._get_torch_home(), "pyg_test_model.pt")
      torch.save(model, path)
  
      model = torch.load(path)
      with torch.no_grad():
          assert model(x, edge_index).size() == (3, 16)
  
      model = GraphSAGE(8, 16, num_layers=3)
      path = osp.join(
          torch.hub._get_torch_home(), "pyg_test_package.pt"
      )
      with torch.package.PackageExporter(path) as pe:
          pe.extern("torch_geometric.nn.**")
          pe.extern("torch_geometric.inspector")
          pe.extern("torch_geometric.utils._trim_to_layer")
          pe.extern("_operator")
          pe.save_pickle("models", "model.pkl", model)
  
      pi = torch.package.PackageImporter(path)
      model = pi.load_pickle("models", "model.pkl")
      with torch.no_grad():
          assert model(x, edge_index).size() == (3, 16)
  
imports: import os
  import os.path
  import random
  import sys
  import warnings
  import pytest
  import torch
  import torch.nn.functional
  import torch_geometric.typing
  from torch_geometric.data import Data
  from torch_geometric.loader import NeighborLoader
  from torch_geometric.nn import SAGEConv
  from torch_geometric.nn.models import GAT, GCN, GIN, PNA, EdgeCNN, GraphSAGE
  from torch_geometric.profile import benchmark
  from torch_geometric.testing import onlyFullTest, onlyLinux, onlyNeighborSampler, onlyOnline, withCUDA, withPackage
label_desc: Use image node_id 12 for calling a global function with example usage: test_packaging() without return types