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

Method transform_to_tl1

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

Source from the content-addressed store, hash-verified

809 return result.type(dtype)
810
811 def transform_to_tl1(self, x: np.ndarray):
812 scale = np.max(np.abs(x))
813 # res = np.round(x / scale + 2).astype(np.uint8)
814 res = preprocess_weights_tl1(x)
815 return res, scale
816
817 def transform_to_tl2(self, x: np.ndarray):
818 scale = np.max(np.abs(x))

Callers 1

write_tensorsMethod · 0.95

Calls 1

preprocess_weights_tl1Function · 0.70

Tested by

no test coverage detected