MCPcopy Create free account
hub / github.com/NVIDIA/cutlass / compress

Method compress

examples/python/CuTeDSL/utils/sparse_utils.py:80–88  ·  view source on GitHub ↗
(self, a, a_compressed, meta, run_on_cpu: bool)

Source from the content-addressed store, hash-verified

78 self.__init__(a.shape[0], a.shape[1], a.shape[2])
79
80 def compress(self, a, a_compressed, meta, run_on_cpu: bool):
81 if run_on_cpu:
82 if a.device.type != "cpu":
83 raise ValueError("a must be on cpu")
84 return self.__compress_on_cpu(a, a_compressed, meta)
85 else:
86 if a.device.type != "cuda":
87 raise ValueError("a must be on cuda")
88 return self.__compress_on_cuda(a, a_compressed, meta)
89
90 def __compress_on_cpu(self, a, a_compressed, meta):
91 """

Callers 2

test_sparse_cpuFunction · 0.95
test_sparse_cudaFunction · 0.95

Calls 2

__compress_on_cpuMethod · 0.95
__compress_on_cudaMethod · 0.95

Tested by 2

test_sparse_cpuFunction · 0.76
test_sparse_cudaFunction · 0.76