I convert this problem to a "finding equal values in two expanded matrixes’.  Here is the code:
target = torch.tensor([1.25, 2.5, 3, 1.25, 3])
values = torch.tensor([1.25, 2.5, 3])

t_size = target.numel()
v_size = values.numel()

t_expand = target.unsqueeze(1).expand(t_size, v_size) 
v_expand = v_size.unsqueeze(0).expand(t_size, v_size)

result = (t_expand - v_expand == 0).nonzero()[:,1]