y = np.random.randn(300, 400)
with open('/tmp/testbin', 'wb') as f:
    np.array(x.shape).tofile(f)
x.tofile(f)
np.array(y.shape).tofile(f)
y.tofile(f)
x1, y1 = iter_arrays('/tmp/testbin')
assert np.allclose(x, x1) and np.allclose(y, y1)
How can I read successive arrays from a binary file using `np.fromfile`?