code: def test_sparse_softmax_sputnik(device):
      B, L = 8, 30
      prob = 0.5
      a = _create_random_sparsity(
          torch.rand(B, L, L, device=device), prob
      )
  
      a_csr = xformers.components.attention.core.SparseCS(a, device)
  
      fn = xformers.components.attention.core._softmax
  
      a = a.to_sparse()
  
      res = fn(a_csr)
      res_gt = fn(a)
  
      res = res.to_dense()
      res_gt = res_gt.to_dense()
  
      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 11 for calling a global function with example usage: test_sparse_softmax_sputnik(device) without return types