Could use `data = np.zeros(dataset.total_size*np.prod(dim))`