code: def test_matmul(without_extensions, device):
      kwargs = dict(sort_order="row", device=device)
      adj = EdgeIndex([[0, 1, 1, 2], [1, 0, 2, 1]], **kwargs)
      x = torch.randn(3, 1, device=device)
      expected = adj.to_dense() @ x
  
      out = adj @ x
      assert torch.allclose(out, expected)
  
      out = adj.matmul(x)
      assert torch.allclose(out, expected)
  
      out = torch.mm(adj, x)
      assert torch.allclose(out, expected)
  
      out = torch.matmul(adj, x)
      assert torch.allclose(out, expected)
  
      if torch_geometric.typing.WITH_PT20:
          out = torch.sparse.mm(adj, x, reduce="sum")
      else:
          with pytest.raises(
              TypeError, match="got an unexpected keyword"
          ):
              torch.sparse.mm(adj, x, reduce="sum")
          out = torch.sparse.mm(adj, x)
      assert torch.allclose(out, expected)
  
imports: import os.path
  import warnings
  from typing import List, Optional
  import pytest
  import torch
  from torch import Tensor, tensor
  import torch_geometric
  from torch_geometric import EdgeIndex
  from torch_geometric.edge_index import SUPPORTED_DTYPES, ReduceType, SortReturnType, _scatter_spmm, _torch_sparse_spmm, _TorchSPMM, set_tuple_item
  from torch_geometric.profile import benchmark
  from torch_geometric.testing import onlyCUDA, onlyLinux, withCUDA, withoutExtensions, withPackage
  from torch_geometric.typing import SparseTensor
  from torch_geometric.utils import scatter
label_desc: Use image node_id 30 for calling a global function with example usage: test_matmul(without_extensions, device) without return types