Based on the error message, if seems wt has only a single dimension.
If you want to normalize using dim=1, make sure your tensor has at least two valid dims:
F.normalize(torch.randn(10, 10), p=2, dim=1) # works
F.normalize(torch.randn(10), p=2, dim=1) # throws your error