code: def test_spmm_reduce(device, reduce):
      src = torch.randn(5, 4, device=device)
      other = torch.randn(4, 8, device=device)
  
      if src.is_cuda:
          with pytest.raises(
              NotImplementedError, match="not yet supported"
          ):
              spmm(src.to_sparse_csr(), other, reduce)
      else:
          out1 = spmm(src.to_sparse_csr(), other, reduce)
          assert out1.size() == (5, 8)
          if torch_geometric.typing.WITH_TORCH_SPARSE:
              out2 = spmm(
                  SparseTensor.from_dense(src), other, reduce=reduce
              )
              assert torch.allclose(out1, out2)
  
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 2 for calling a global function with example usage: test_spmm_reduce(device, reduce) without return types