>>> a = torch.rand(10)/100 + 0.3 * torch.randint(1,4,(10,)).float()
>>> a
tensor([0.3033, 0.3015, 0.6091, 0.3027, 0.9099, 0.6055, 0.3092, 0.3045, 0.6024, 0.9005])
>>> torch.round(a / 0.3).long()
tensor([1, 1, 2, 1, 3, 2, 1, 1, 2, 3])

The integer tensor can serve as index to get a value.