torch.uint8 was used as a bool index in past PyTorch versions and you should also get a warning:
UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead. 

To index a tensor use LongTensors or a mask via BoolTensors.