finish bitnet i2 e2e
This commit is contained in:
parent
2a01a7ce0d
commit
4e1ab50628
6 changed files with 16 additions and 637 deletions
|
@ -1431,7 +1431,7 @@ class BitnetModel(Model):
|
|||
if x[i] != 0:
|
||||
scale = x[i]
|
||||
break
|
||||
x = np.divide(x, scale)
|
||||
x = np.where(x * scale > 0, 1, np.where(x * scale < 0, -1, x))
|
||||
x = x.astype(np.uint8)
|
||||
x = np.reshape(x, [x.shape[0] // 4, 4])
|
||||
keep_bit = {0:192, 1:48, 2:12, 3:3}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue