code: def test_spmm_sputnik(device):
      B, L, K = 8, 30, 32
      prob = 0.5
  
      a = _create_random_sparsity(
          torch.rand(B, L, L, device=device), prob
      )
  
      b = torch.rand(B, L, K, device=device)
  
      a_csr = xformers.components.attention.core.SparseCS(a, device)
  
      fn = xformers.components.attention.core.bmm
  
      a = a.to_sparse()
  
      res = fn(a_csr, b)
      res_gt = fn(a, b)
  
      res = res
      res_gt = res_gt
  
      assert res.dtype == res_gt.dtype
      assert torch.allclose(res, res_gt)
  
imports: import pytest
  import torch
  import xformers
  import xformers.components.attention.core
  from xformers.components.attention._sputnik_sparse import _csr_to_coo
  from xformers.components.attention.core import _broadcast_batch, _create_random_sparsity, _sparse_bmm
label_desc: Use image node_id 13 for calling a global function with example usage: test_spmm_sputnik(device) without return types