torch.load('tensors.pt')
# 把所有的張量加載到CPU中
torch.load('tensors.pt', map_location=lambda storage, loc: storage)
# 把所有的張量加載到GPU 1中
torch.load('tensors.pt', map_location=lambda storage, loc: storage.cuda(1))
# 把張量從GPU 1 移動到 GPU 0
torch.load('tensors.pt', map_location={'cuda:1':'cuda:0'})
