Alterar pytorch do tipo tensor

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