Hi,
Does the original input requires gradient? If so, the main difference I can see is that all the intermediate results that the autograd needs to save will be on different devices.
But otherwise, i don’t see why one would consume more memory. How do you measure the memory usage of each of these functions?
I would advise against doing:
    with torch.cuda.device(gpu):
        del flipped
        del salted
        del peppered
        torch.cuda.empty_cache()

The del will happen anyway when you exit the function and the empty cache is not going to be doing anything but slow down your code.