class_docstr: This contains cuSPARSELt specific tests.
class_docstr_tok: ["This","contains","cuSPARSELt","specific","tests","."]
code: def test_cslt_sparse_mm_alpha(self, dtype, device):
      A = torch.Tensor([0, 0, 1, 1]).tile((128, 64)).to(dtype).cuda()
      B = torch.ones((256, 128), device=device).to(dtype)
      alpha = torch.Tensor([2 ** (-i) for i in range(128)]).cuda()
  
      A_compressed = torch._cslt_compress(A)
      sparse_result = torch._cslt_sparse_mm(
          A_compressed, B, alpha=alpha
      )
  
      alpha_scaled = torch.stack([alpha] * 128).t()
      dense_result = alpha_scaled * torch.mm(
          A.to(torch.float32), B.to(torch.float32)
      )
      dense_result = dense_result.to(dtype)
  
      assert torch.allclose(
          sparse_result, dense_result, rtol=1e-3, atol=1e-3
      )
  
imports: import itertools
  import random
  import unittest
  import torch
  from torch import nn
  from torch.sparse.semi_structured import _DTYPE_TO_SEMI_STRUCTURED_SPARSE_CONFIG, SparseSemiStructuredTensor, to_sparse_semi_structured
  from torch.testing import make_tensor
  from torch.testing._internal.common_device_type import dtypes, instantiate_device_type_tests
  from torch.testing._internal.common_dtype import all_types_and_complex
  import torch._dynamo.test_case
  from torch.testing._internal.common_utils import parametrize, run_tests, subtest, TestCase, TEST_WITH_ROCM, IS_WINDOWS
  from torch.utils._triton import has_triton
label_desc: Use image node_id 3 for calling the TestCUSPARSELT obj's underlying member method code with example usage: obj.test_cslt_sparse_mm_alpha(dtype, device) without return types