Hello all, I have a batch from dataloader likes
images, targets=batch

The size of images is BxCXHxW. I want to random flip each image in images batch. How to do it ? I am using for loop but I guess we have better way
for i in range (images.size(0)):
    image= images[i,...]
    if np.random.randn()>0.5:
        image = image.flip(2)
        images[i,...]= image