def _unpack_matrix(fid, rows, cols, dtype, out_dtype):
 dtype = np.dtype(dtype)
 string = fid.read(int(((dtype.itemsize * rows) * cols)))
 out = np.fromstring(string, dtype=dtype).reshape(rows, cols).astype(out_dtype)
 return out

def _unpack_matrix ( fid , rows , cols , dtype , out_dtype ) : dtype = np . dtype ( dtype ) string = fid . read ( int ( ( ( dtype . itemsize * rows ) * cols ) ) ) out = np . fromstring ( string , dtype = dtype ) . reshape ( rows , cols ) . astype ( out_dtype ) return out
unpack matrix .