Here 18 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]])
c = torch.FloatTensor([[0.1, 0.3]])
torch.nn.functional.triplet_margin_loss(a,b,c)

output
tensor(1.0000)