Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert numpy array to tensor

import numpy as np
import torch

numpy_array = np.array([1,3,5])
tensor_array = torch.from_numpy(numpy_array)
Source by pytorch.org #
 
PREVIOUS NEXT
Tagged: #convert #numpy #array #tensor
ADD COMMENT
Topic
Name
5+9 =