Pytorch is one of the most popular deep learning frameworks
the frameworks used in many published deep learning papers
intuitive and user-friendly
has much in common with NumPy
Tensors: the building blocks of networks in PyTorch
load from list
import torch
lst = [[1,2,3],[4,5,6]]
tensor = torch.tensor(lst)
load from NumPy array
np_array = np.array(array)
np_tensor = torch.from_numpy(np_array)
Tensor
Tensor attributes