code: def test_sparse_bmm(device, contiguous, prob, N):
      B, M = 8, 64
      a = torch.rand(B, M, N, device=device)
      a[a < prob] = 0
      a = a.to_sparse()
      b = torch.rand(B, N, M, device=device)
      if not contiguous:
          a = a + a
          b = b.transpose(-2, -1).contiguous().transpose(-2, -1)
  
      res = _sparse_bmm(a, b)
      res_gt = _baseline_sparse_bmm(a, b)
  
      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 16 for calling a global function with example usage: test_sparse_bmm(device, contiguous, prob, N) without return types