📜  numpy 数组到火炬张量 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:15.526000             🧑  作者: Mango

代码示例3
import numpy as np
import torch

numpy_array = np.array([1,3,5])
tensor_array = torch.from_numpy(numpy_array)