What is the difference between using cuda tensor and cpu tensor when indexing cuda tensor?
For example,
if use_cuda:
index = torch.randperm(batch_size).cuda()
else:
index = torch.randperm(batch_size)
mixed_x = lam * x + (1 - lam) * x[index, :]
y_a, y_b = y, y[index]
Above code is from https://github.com/facebookresearch/mixup-cifar10
Is it faster? (I see no difference between them when training)