Solved by InnovArul in post #2 
              
              
                import torch.nn.functional as F
input = F.normalize(input, p=2, dim=1)

I am not clear what is meant by pixelwise division.