创建一个tensor a = torch.arange(10) ''' tensor([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) device(type='cpu') 默认在cpu上 ''' 从cpu转到gpu上 a = torch.arange(10).cuda() ''' device(type='cuda', index=