Solved by ptrblck in post #2 
              
              
                I don’t think this is supported in torchvision transformations, as literals are expected and tensor inputs would raise an error. 
However, Kornia is a differentiable computer vision library and might be helpful.  
CC @edgarriba as the core dev