本文记录cpu张量、cuda张量、list和array之间的转换关系。import torchimport numpy as np# list -> tensor(cpu)l0 = [1, 2, 3]t = torch.
確定! 回上一頁