Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

torch.from_numpy

>>> a = numpy.array([1, 2, 3])
>>> t = torch.from_numpy(a)
>>> t
tensor([ 1,  2,  3])
>>> t[0] = -1
>>> a
array([-1,  2,  3])
Source by pytorch.org #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
6+9 =