1#!/usr/bin/python 2 3from __future__ import print_function 4 5import numpy as np 6import h5py 7import sys 8 9data = np.fromfile(sys.argv[1], dtype='float32'); 10data = np.reshape(data, (int(sys.argv[2]), int(sys.argv[3]))); 11h5f = h5py.File(sys.argv[4], 'w'); 12h5f.create_dataset('data', data=data) 13h5f.close() 14