MCPcopy Create free account
hub / github.com/kyegomez/BitNet / test_absmax_quantize

Function test_absmax_quantize

tests/tests.py:15–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13
14
15def test_absmax_quantize():
16 tensor = torch.tensor([1.5, -2.0, 3.0, -4.0])
17 quant, dequant = absmax_quantize(tensor)
18 assert quant.dtype == torch.int8
19 assert torch.allclose(dequant, tensor, atol=1e-2)
20
21
22def test_bitlinear_initialization():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected