Nomic vulkan backend licensed under the Software for Open Models License (SOM), version 1.0.
This commit is contained in:
parent
acfc5478ff
commit
4cdaa3c9cb
97 changed files with 13550 additions and 26 deletions
18
undump.py
Normal file
18
undump.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
import struct
|
||||
import numpy as np
|
||||
from pathlib import Path
|
||||
|
||||
def undump(fn):
|
||||
with open(fn, 'rb') as df:
|
||||
dims = struct.unpack('=QQQQ', df.read(8*4))
|
||||
(dsz,) = struct.unpack('=Q', df.read(8))
|
||||
## assume f32
|
||||
data = df.read(dsz)
|
||||
data = [i for (i,) in struct.iter_unpack('=f', data)]
|
||||
return np.array(data).reshape(dims).squeeze()
|
||||
|
||||
if __name__ == '__main__':
|
||||
for dfn in sorted(Path('.').glob('*.dump')):
|
||||
darr = undump(dfn)
|
||||
print(f'{dfn}: {darr.shape}\n{darr}')
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue