Hi there,
I have a very newby question …
I have a torch tensor of float values as:
torch.tensor([[1., 2., 3.], [1., 3., 2.]])
From it, I want to create a mask vector of 0 and 1 where 1 is the max value of the row:
torch.tensor([[0,0,1],[0,1,0]])
I can use the indices returned by torch.max(dim=-1,…) iterate over them and write 1 but I want to know if exists a more fast way to create such mask vectors.
Thank you!