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