Numpy: creating batch of numpy arrays within another numpy array (reshaping)
import numpy as np# fabricate some databatch = np.array((32, 1), dtype=object)for i in range(len(batch)): batch[i] = [np.random.rand(84, 84, 3), None, None]# select imagesresult = np.array([img for img, _, _ in batch])# double check!for i in range(len(batch)): assert np.all(result[i, :, :, :] == batch[i][0])