Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated linalg functions in tensors_deeper_tutorial.py #2959

Merged
merged 2 commits into from
Aug 1, 2024

Conversation

ignaciobartol
Copy link
Contributor

@ignaciobartol ignaciobartol commented Jun 28, 2024

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

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

cc @albanD

Copy link

pytorch-bot bot commented Jun 28, 2024

🔗 Helpful Links

🧪 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.

✅ No Failures

As of commit 8050120 with merge base 740e3b0 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@svekars svekars added the core Tutorials of any level of difficulty related to the core pytorch functionality label Jun 28, 2024
Copy link
Contributor

@albanD albanD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great and thank you for the detailed PR description!

@svekars svekars merged commit 89b3343 into pytorch:main Aug 1, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed core Tutorials of any level of difficulty related to the core pytorch functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] - UserWarning: Using torch.cross without specifying the dim arg is deprecated.
4 participants