np_array = np.array(data) x_np = torch.from_numpy(np_array)
import numpy as np import torch numpy_array = np.array([1,3,5]) tensor_array = torch.from_numpy(numpy_array)
n = np.ones(5) t = torch.from_numpy(n)