code: def test_summary_with_to_hetero_model():
      x_dict = {
          "p": torch.randn(100, 16),
          "a": torch.randn(100, 16),
      }
      edge_index_dict = {
          ("p", "to", "p"): torch.randint(100, (2, 200)),
          ("p", "to", "a"): torch.randint(100, (2, 200)),
          ("a", "to", "p"): torch.randint(100, (2, 200)),
      }
      metadata = list(x_dict.keys()), list(edge_index_dict.keys())
      model = to_hetero(GraphSAGE(), metadata)
  
      expected = """
  +---------------------------+---------------------+----------------+----------+
  | Layer                     | Input Shape         | Output Shape   | #Param   |
  |---------------------------+---------------------+----------------+----------|
  | GraphModule               |                     |                | 5,824    |
  | ├─(lin1)ModuleDict        | --                  | --             | 544      |
  | │    └─(p)Linear          | [100, 16]           | [100, 16]      | 272      |
  | │    └─(a)Linear          | [100, 16]           | [100, 16]      | 272      |
  | ├─(conv1)ModuleDict       | --                  | --             | 3,168    |
  | │    └─(p__to__p)SAGEConv | [100, 16], [2, 200] | [100, 32]      | 1,056    |
  | │    └─(p__to__a)SAGEConv | [2, 200]            | [100, 32]      | 1,056    |
  | │    └─(a__to__p)SAGEConv | [2, 200]            | [100, 32]      | 1,056    |
  | ├─(lin2)ModuleDict        | --                  | --             | 2,112    |
  | │    └─(p)Linear          | [100, 32]           | [100, 32]      | 1,056    |
  | │    └─(a)Linear          | [100, 32]           | [100, 32]      | 1,056    |
  +---------------------------+---------------------+----------------+----------+
  """
      assert summary(model, x_dict, edge_index_dict) == expected[1:-1]
  
imports: from typing import Optional
  import pytest
  import torch
  from torch import Tensor, nn
  import torch_geometric.typing
  from torch_geometric.nn import Linear, SAGEConv, summary, to_hetero
  from torch_geometric.nn.models import GCN
  from torch_geometric.testing import withPackage
  from torch_geometric.typing import SparseTensor
label_desc: Use image node_id 8 for calling a global function with example usage: test_summary_with_to_hetero_model() without return types