List

import torch tensor = torch.tensor([1,2,3,4])

Numpy

import torch ntensor = torch.from_numpy(matrix)