Skip to content

Commit 92c28b3

Browse files
authored
Merge branch 'main' into main
2 parents 3c0a254 + 89b3343 commit 92c28b3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

beginner_source/introyt/tensors_deeper_tutorial.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -448,17 +448,19 @@
448448
m2 = torch.tensor([[3., 0.], [0., 3.]]) # three times identity matrix
449449

450450
print('\nVectors & Matrices:')
451-
print(torch.cross(v2, v1)) # negative of z unit vector (v1 x v2 == -v2 x v1)
451+
print(torch.linalg.cross(v2, v1)) # negative of z unit vector (v1 x v2 == -v2 x v1)
452452
print(m1)
453-
m3 = torch.matmul(m1, m2)
453+
m3 = torch.linalg.matmul(m1, m2)
454454
print(m3) # 3 times m1
455-
print(torch.svd(m3)) # singular value decomposition
455+
print(torch.linalg.svd(m3)) # singular value decomposition
456456

457457

458458
##################################################################################
459459
# This is a small sample of operations. For more details and the full inventory of
460460
# math functions, have a look at the
461461
# `documentation <https://pytorch.org/docs/stable/torch.html#math-operations>`__.
462+
# For more details and the full inventory of linear algebra operations, have a
463+
# look at this `documentation <https://pytorch.org/docs/stable/linalg.html>`__.
462464
#
463465
# Altering Tensors in Place
464466
# ~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)