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

Method transform_to_tl2

utils/generate-dummy-bitnet-model.py:817–821  ·  view source on GitHub ↗
(self, x: np.ndarray)

Source from the content-addressed store, hash-verified

815 return res, scale
816
817 def transform_to_tl2(self, x: np.ndarray):
818 scale = np.max(np.abs(x))
819 # res = np.round(x / scale + 2).astype(np.uint8)
820 res = preprocess_weights_tl2(x)
821 return res, scale
822
823 # generate dummy model
824 def generate_tensors(self) -> Iterator[tuple[str, np.ndarray]]:

Callers 1

write_tensorsMethod · 0.95

Calls 1

preprocess_weights_tl2Function · 0.70

Tested by

no test coverage detected