Hi Peter!



 ptrblck:

F.one_hot should yield the same result as the scatter operation  :
x = torch.tensor([1, 2, 0, 2, 2, 2, 2, 1])
F.one_hot(x, num_classes=4)



Thanks @ptrblck.  one_hot() is just the ticket to replace the
scatter() / unsqueeze() nonsene.
Best.
K. Frank