tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

Updated linalg functions in tensors_deeper_tutorial.py

Open ignaciobartol opened this issue 1 year ago • 1 comments

Fixes #2933

Description

Hi, after reading #2933, there are a few things that I noted while attempting to solve this issue:

  1. While torch.cross is more flexible and allows you for more complex cross products, I believe the expected behavior is usually the one from torch.linalg.cross implementation. In this discussion it explains why blindly using torch.cross can lead you to an intersting bug-hunting.
  2. The function torch.svd is deprecated and will be removed in future pytorch release.
  3. For completion and to avoid beginner user confusion, I also changed to use torch.linalg.matmul which actually calls torch.matmul, but I think it would be better from a beginner user standpoint, to refer them to torch.linalg for all linear algebra related operations.
  4. It would be nice to add maybe a tag/flag in the youtube video here mentioning the updates to linear algebra operations.
  5. Added ref to torch.linalg docs.

Checklist

  • [x] The issue that is being fixed is referred in the description
  • [x] Only one issue is addressed in this pull request
  • [ ] Labels from the issue that this PR is fixing are added to this pull request
  • [x] No unnecessary issues are included into this pull request.

cc @albanD

ignaciobartol avatar Jun 28 '24 09:06 ignaciobartol

:link: Helpful Links

:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/2959

Note: Links to docs will display an error until the docs builds have been completed.

:white_check_mark: No Failures

As of commit 80501207d21a4acea1c3a70626c755b5017e66a4 with merge base 740e3b01fc928b8fdb13762a8c52c844fbd0f792 (image): :green_heart: Looks good so far! There are no failures yet. :green_heart:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

pytorch-bot[bot] avatar Jun 28 '24 09:06 pytorch-bot[bot]