MCPcopy Create free account
hub / github.com/microsoft/BitNet / forward

Method forward

gpu/model.py:73–75  ·  view source on GitHub ↗
(self, input)

Source from the content-addressed store, hash-verified

71 return (input * s).round().clamp(-128, 127).to(torch.int8), s
72
73 def forward(self, input):
74 input, s = self.quant_input(input)
75 return bitnet_int8xint2_linear(input, self.weight, s, self.weight_scale)
76
77class BitLinear(nn.Linear):
78 @torch.compile

Callers

nothing calls this directly

Calls 2

quant_inputMethod · 0.95
bitnet_int8xint2_linearFunction · 0.70

Tested by

no test coverage detected