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

Function test_compress_keys_shapes

tests/test_compress.py:28–37  ·  view source on GitHub ↗
(seq_k, total_bits)

Source from the content-addressed store, hash-verified

26@pytest.mark.parametrize("seq_k", [64, 128, 256, 512])
27@pytest.mark.parametrize("total_bits", [3, 4])
28def test_compress_keys_shapes(seq_k, total_bits):
29 engine = TurboQuantEngine(head_dim=128, total_bits=total_bits, device="cpu")
30 K = _make_random_keys(seq_k)
31 compressed = engine.compress_keys_pytorch(K)
32
33 assert compressed["indices"].shape == (seq_k, 128)
34 assert compressed["k_mse"].shape == (seq_k, 128)
35 assert compressed["qjl_signs"].shape == (seq_k, 128)
36 assert compressed["vec_norms"].shape == (seq_k,)
37 assert compressed["residual_norms"].shape == (seq_k,)
38
39
40@pytest.mark.parametrize("total_bits", [3, 4])

Callers

nothing calls this directly

Calls 3

compress_keys_pytorchMethod · 0.95
TurboQuantEngineClass · 0.90
_make_random_keysFunction · 0.85

Tested by

no test coverage detected