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

Function test_bitlinear_weight_group_normalization

tests/tests.py:102–106  ·  view source on GitHub ↗
(groups)

Source from the content-addressed store, hash-verified

100
101@pytest.mark.parametrize("groups", [1, 2, 5])
102def test_bitlinear_weight_group_normalization(groups):
103 layer = BitLinear(10, 20, groups=groups)
104 weight = layer.weight.view(groups, -1)
105 mean = weight.mean(dim=1, keepdim=True)
106 assert torch.allclose(mean, torch.zeros_like(mean), atol=1e-2)
107
108
109def test_bitlinear_weight_group_scaling():

Callers

nothing calls this directly

Calls 1

BitLinearClass · 0.90

Tested by

no test coverage detected