Replacing elements in a tensor?

Hi, I want to replace elements in a tensor according to certain standard
for example, let’s say a tensor has elements ranging from 0 to 10
and I want to replace values 0~3 to 0, value 4~7 to 1, and 8~10 to 2.
Is there any function that can do this job?

tensor = torch.arange(11).float()
tensor = torch.floor(tensor / 4)