from numpy.ndarray feature vector to tensor pytorch code example Example: convert numpy to torch torch.from_numpy(your_array)