I tried to open a .bin file with np.fromfile. However, I am not sure what is the right way to load the file correctly. Here is the code that produced this .bin file. Thanks!
def write_bin(file_path,data_np): #data_np is a float32 array with shape (1, 64, 1)
file_path = file_path + '.bin'
dim_np = np.array((data_np.shape),dtype=np.int32)
dim_num = np.int32(len(dim_np))
output_file = open(file_path, 'wb')
output_file.write(dim_num) # write dim_num (np.int32)
output_file.write(np.array(dim_np)) # write dim_np (np.int32)
output_file.write((data_np)) # write array (np.float32)
output_file.close()
return