torch.Tensor.long Tensor.long(memory_format=torch.preserve_format) → Tensor self.long() is equivalent to self.to(torch.int64). See .