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

Function test_bitlinear_quantization

tests/test_bitlinear.py:28–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26
27
28def test_bitlinear_quantization():
29 bitlinear = BitLinear(in_features=512, out_features=256, bias=True)
30 x = torch.randn(1, 512)
31 out = bitlinear(x)
32 assert torch.all(out <= bitlinear.beta.unsqueeze(0).expand_as(out))
33 assert torch.all(out >= -bitlinear.beta.unsqueeze(0).expand_as(out))

Callers

nothing calls this directly

Calls 1

BitLinearClass · 0.90

Tested by

no test coverage detected