Solved by tom in post #2 
              
              
                Hi, 
you can vectorize it: mt = torch.FloatTensor(mean).view(3,1,1), st similar allows you to do img*mt. This is by virtue of the broadcasting implemented in PyTorch. As PyTorch automatically prepends dimensions, it even works if img is a batch of images. 
Best regards 
Thomas