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

Function test_bitnet_transformer_logit_values

tests/tests.py:269–273  ·  view source on GitHub ↗
(bitnet_model)

Source from the content-addressed store, hash-verified

267
268
269def test_bitnet_transformer_logit_values(bitnet_model):
270 tokens = torch.randint(0, 20000, (1, 512))
271 logits = bitnet_model(tokens)
272 probs = F.softmax(logits, dim=-1)
273 assert torch.allclose(probs.sum(dim=-1), torch.tensor(1.0))
274
275
276# Mocking and Monkeypatching

Callers

nothing calls this directly

Calls 1

bitnet_modelFunction · 0.85

Tested by

no test coverage detected