Cast Tensor Type Pytorch

y = y.to(torch.long)
# torch.long, torch.int16, torch.int32, torch.float16, etc.
CodeHunter