code: def test_hetero_linear_sort(type_vec, device):
      x = torch.randn(type_vec.numel(), 16, device=device)
  
      lin = HeteroLinear(16, 32, num_types=3).to(device)
      out = lin(x, type_vec)
  
      for i in range(type_vec.numel()):
          node_type = int(type_vec[i])
          expected = x[i] @ lin.weight[node_type] + lin.bias[node_type]
          assert torch.allclose(out[i], expected, atol=1e-3)
  
imports: import copy
  import warnings
  from typing import List
  import pytest
  import torch
  from torch import Tensor
  from torch.nn import Linear
  from torch.nn.parameter import UninitializedParameter
  import torch_geometric.backend
  from torch_geometric.nn import HeteroDictLinear, HeteroLinear, Linear
  from torch_geometric.profile import benchmark
  from torch_geometric.testing import withCUDA, withPackage
  from torch_geometric.typing import pyg_lib
  from torch_geometric.utils import cumsum
label_desc: Use image node_id 14 for calling a global function with example usage: test_hetero_linear_sort(type_vec, device) without return types