class_docstr: This contains cuSPARSELt specific tests.
class_docstr_tok: ["This","contains","cuSPARSELt","specific","tests","."]
code: def test_cslt_sparse_mm_int8_in_fp16_out(
      self, dense_input_shape, device
  ):
      A = rand_sparse_semi_structured_mask(128, 128, dtype=torch.int8)
      A_compressed = torch._cslt_compress(A)
  
      B = torch.rand(dense_input_shape, device=device).to(torch.int8)
  
      dense_result = torch.mm(
          A.cpu().to(torch.int64), B.t().cpu().to(torch.int64)
      ).to(device, dtype=torch.float16)
      sparse_result = torch._cslt_sparse_mm(
          A_compressed, B.t(), out_dtype=torch.float16
      )
      assert torch.allclose(
          dense_result, sparse_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 2 for calling the TestCUSPARSELT obj's underlying member method code with example usage: obj.test_cslt_sparse_mm_int8_in_fp16_out(dense_input_shape, device) without return types