(groups)
| 100 | |
| 101 | @pytest.mark.parametrize("groups", [1, 2, 5]) |
| 102 | def 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 | |
| 109 | def test_bitlinear_weight_group_scaling(): |