code: def test_spmm_layout(device, layout, reduce):
      src = torch.randn(5, 4, device=device)
      if layout == torch.sparse_coo:
          src = src.to_sparse_coo()
      elif layout == torch.sparse_csr:
          src = src.to_sparse_csr()
      else:
          assert layout == torch.sparse_csc
          src = src.to_sparse_csc()
      other = torch.randn(4, 8, device=device)
  
      if src.is_cuda and reduce in {"min", "max"}:
          with pytest.raises(
              NotImplementedError, match="not yet supported"
          ):
              spmm(src, other, reduce=reduce)
      elif layout != torch.sparse_csr:
          with pytest.warns(
              UserWarning, match="Converting sparse tensor"
          ):
              spmm(src, other, reduce=reduce)
      else:
          spmm(src, other, reduce=reduce)
  
file_path: pytorch_geometric/test/utils/test_spmm.py
imports: import itertools
  import warnings
  import pytest
  import torch
  from torch import Tensor
  import torch_geometric.typing
  from torch_geometric.profile import benchmark
  from torch_geometric.testing import withCUDA, withPackage
  from torch_geometric.typing import SparseTensor
  from torch_geometric.utils import spmm, to_torch_coo_tensor
label_desc: Use image node_id 3 for calling a global function with example usage: test_spmm_layout(device, layout, reduce) without return types