if (not self.opt.no_flip) and random.random() < 0.5:
idx = [i for i in range(A.size(2) - 1, -1, -1)] // size(2)-1, size(2)-2, ... , 0
idx = torch.LongTensor(idx)
A = A.index_select(2, idx)
// let B directly equals A
B = A.clone()
After Change
w_offset:w_offset + self.opt.fineSize]
if (not self.opt.no_flip) and random.random() < 0.5:
A = torch.flip(A, [2])
// let B directly equals to A
B = A.clone()
A_flip = torch.flip(A, [2])
B_flip = A_flip.clone()
// Just zero the mask is fine if not offline_loading_mask.
mask = A.clone().zero_()