Solved by ptrblck in post #2 
              
              
                You could use the functional API of torchvision.transforms as given in this example. 
This would make sure to apply the same “random” transformation on all image slices. 
Let me know, if this would work for you.