MCPcopy Index your code
hub / github.com/microsoft/BitNet / weight_quant

Function weight_quant

utils/convert-ms-to-gguf-bitnet.py:953–958  ·  view source on GitHub ↗
(weight)

Source from the content-addressed store, hash-verified

951 return x.to(dtype)
952
953def weight_quant(weight):
954 weight = torch.tensor(weight, dtype=torch.float32)
955 weight = forward_t(weight)
956 # Use tolist() then convert to numpy to avoid PyTorch-NumPy compatibility issues
957 weight = np.array(weight.tolist(), dtype=np.float32)
958 return weight
959
960def part_lazy_q(lazy_tensor: LazyTensor, n_part: int) -> LazyTensor:
961 def load() -> Tensor:

Callers 1

loadFunction · 0.85

Calls 1

forward_tFunction · 0.85

Tested by

no test coverage detected