code: def test_hetero_dict_linear(bias, device):
      x_dict = {
          "v": torch.randn(3, 16, device=device),
          "w": torch.randn(2, 8, device=device),
      }
  
      lin = HeteroDictLinear({"v": 16, "w": 8}, 32, bias=bias).to(
          device
      )
      assert str(lin) == (
          f"HeteroDictLinear({{'v': 16, 'w': 8}}, 32, " f"bias={bias})"
      )
  
      out_dict = lin(x_dict)
      assert len(out_dict) == 2
      assert out_dict["v"].size() == (3, 32)
      assert out_dict["w"].size() == (2, 32)
  
      x_dict = {
          "v": torch.randn(3, 16, device=device),
          "w": torch.randn(2, 16, device=device),
      }
  
      lin = HeteroDictLinear(16, 32, types=["v", "w"], bias=bias).to(
          device
      )
      assert str(lin) == (
          f"HeteroDictLinear({{'v': 16, 'w': 16}}, 32, " f"bias={bias})"
      )
  
      out_dict = lin(x_dict)
      assert len(out_dict) == 2
      assert out_dict["v"].size() == (3, 32)
      assert out_dict["w"].size() == (2, 32)
  
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 11 for calling a global function with example usage: test_hetero_dict_linear(bias, device) without return types