code: def test_hetero_conv(aggr):
      data = HeteroData()
      data["paper"].x = torch.randn(50, 32)
      data["author"].x = torch.randn(30, 64)
      data["paper", "paper"].edge_index = get_random_edge_index(
          50, 50, 200
      )
      data["paper", "author"].edge_index = get_random_edge_index(
          50, 30, 100
      )
      data["paper", "author"].edge_attr = torch.randn(100, 3)
      data["author", "paper"].edge_index = get_random_edge_index(
          30, 50, 100
      )
      data["paper", "paper"].edge_weight = torch.rand(200)
  
      # Unspecified edge types should be ignored:
      data["author", "author"].edge_index = get_random_edge_index(
          30, 30, 100
      )
  
      conv = HeteroConv(
          {
              ("paper", "to", "paper"): GCNConv(-1, 64),
              ("author", "to", "paper"): SAGEConv((-1, -1), 64),
              ("paper", "to", "author"): GATConv(
                  (-1, -1), 64, edge_dim=3, add_self_loops=False
              ),
          },
          aggr=aggr,
      )
  
      assert len(list(conv.parameters())) > 0
      assert str(conv) == "HeteroConv(num_relations=3)"
  
      out_dict = conv(
          data.x_dict,
          data.edge_index_dict,
          data.edge_attr_dict,
          edge_weight_dict=data.edge_weight_dict,
      )
  
      assert len(out_dict) == 2
      if aggr == "cat":
          assert out_dict["paper"].size() == (50, 128)
          assert out_dict["author"].size() == (30, 64)
      elif aggr is not None:
          assert out_dict["paper"].size() == (50, 64)
          assert out_dict["author"].size() == (30, 64)
      else:
          assert out_dict["paper"].size() == (50, 2, 64)
          assert out_dict["author"].size() == (30, 1, 64)
  
imports: import random
  import pytest
  import torch
  from torch_geometric.data import HeteroData
  from torch_geometric.datasets import FakeHeteroDataset
  from torch_geometric.nn import GATConv, GCN2Conv, GCNConv, HeteroConv, Linear, MessagePassing, SAGEConv
  from torch_geometric.profile import benchmark
  from torch_geometric.testing import get_random_edge_index, onlyLinux, withCUDA, withPackage
label_desc: Use image node_id 1 for calling a global function with example usage: test_hetero_conv(aggr) without return types