x = torch.tensor([0, 1, 2, 3, 4])
torch.save(x, "tensor.pt")
torch.load("tensors.pt", weights_only=True)
torch.load("tensors.pt", map_location=torch.device("cpu"), weights_only=True)
torch.load("tensors.pt", map_location=torch.device("cuda:0"), weights_only=True)