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

Function test_bitlinear_weight_sign

tests/tests.py:92–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

90
91
92def test_bitlinear_weight_sign():
93 layer = BitLinear(10, 20)
94 input_tensor = torch.randn(5, 10)
95 output_before = layer(input_tensor)
96 layer.weight.data = torch.abs(layer.weight.data)
97 output_after = layer(input_tensor)
98 assert not torch.allclose(output_before, output_after)
99
100
101@pytest.mark.parametrize("groups", [1, 2, 5])

Callers

nothing calls this directly

Calls 1

BitLinearClass · 0.90

Tested by

no test coverage detected