Solved by KFrank in post #2 
              
              
                Hi John! 

Yes, your use of normalize() is correct. 

Just compute the (square of the) norm: 
(torch.nn.functional.normalize (tensor_variable, p = 2, dim = 1)**2).sum (dim = 1)

and check that you get 1 for each row of tensor_input. 

You can find the documentation here: normalize. 
Best. 
K. Frank