ONE - On-device Neural Engine
Loading...
Searching...
No Matches
res2bin Namespace Reference

Functions

 res2bin (infilename, outfilename)
 

Variables

 argc = len(sys.argv)
 

Function Documentation

◆ res2bin()

res2bin.res2bin (   infilename,
  outfilename 
)

Definition at line 11 of file res2bin.py.

11def res2bin(infilename, outfilename):
12 # print("Input filename: ", infilename)
13 # print("Output filename: " , outfilename)
14
15 f = h5py.File(infilename)
16 dset = f[list(f.keys())[0]]
17
18 vals = np.zeros(np.shape(dset), dtype='float32')
19 for i in range(np.size(dset, 0)):
20 vals[i, :] = np.asarray(dset[i], dtype='float32')
21 vals = list(np.reshape(vals, (vals.size)))
22
23 with open(outfilename, 'wb') as outfile:
24 outfile.write(struct.pack('f' * len(vals), *vals))
25
26

Variable Documentation

◆ argc

res2bin.argc = len(sys.argv)

Definition at line 28 of file res2bin.py.