MCPcopy Create free account
hub / github.com/DevTechJr/turboquant_cutile / test_decompress_shape

Function test_decompress_shape

tests/test_decompress.py:15–22  ·  view source on GitHub ↗
(seq_v, total_bits)

Source from the content-addressed store, hash-verified

13@pytest.mark.parametrize("seq_v", [64, 256, 512])
14@pytest.mark.parametrize("total_bits", [3, 4])
15def test_decompress_shape(seq_v, total_bits):
16 engine = TurboQuantEngine(head_dim=128, total_bits=total_bits, device="cpu")
17 V = torch.randn(seq_v, 128).half()
18 compressed = engine.compress_values_pytorch(V)
19 V_recon = engine.decompress_values_pytorch(compressed)
20
21 assert V_recon.shape == (seq_v, 128)
22 assert V_recon.dtype == torch.float16
23
24
25@pytest.mark.parametrize("total_bits", [2, 3, 4])

Callers

nothing calls this directly

Calls 3

TurboQuantEngineClass · 0.90

Tested by

no test coverage detected