Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/kyegomez/BitNet
/ weight_quant
Function
weight_quant
bitnet/bitlinear.py:20–24 ·
view source on GitHub ↗
(w: Tensor)
Source
from the content-addressed store, hash-verified
18
19
20
def
weight_quant(w: Tensor):
21
scale = w.abs().mean()
22
e = w.mean()
23
u = (w - e).sign() * scale
24
return
u
25
26
27
class
BitLinear(nn.Linear):
Callers
1
forward
Method · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected