Solved by kenmikanmi in post #2 
              
              
                Here you can see that: 

Shape: 

Input: (N,D) where D is the vector dimension.
Output: scalar. If reduce is False, then (N).


N is batch size. So you need to add batch dimension for your tensor like this: 
input 
import torch

a = torch.FloatTensor([[0.1, 0.2]])
b = torch.FloatTensor([[0.2, 0.2]])…