假设变量名为ts
方法一:
ts=ts.double() ts=ts.long()
方法二:
ts=ts.type(torch.DoubleTensor()) ts=ts.type(torch.LongTensor())