tutorials
tutorials copied to clipboard
[BUG] - UserWarning: Using torch.cross without specifying the dim arg is deprecated.
Add Link
https://pytorch.org/tutorials/beginner/introyt/tensors_deeper_tutorial.html
Describe the bug
/var/lib/workspace/beginner_source/introyt/tensors_deeper_tutorial.py:462: UserWarning:
Using torch.cross without specifying the dim arg is deprecated.
Please either pass the dim explicitly or simply use torch.linalg.cross.
The default value of dim will change to agree with that of linalg.cross in a future release. (Triggered internally at ../aten/src/ATen/native/Cross.cpp:62.)
Describe your environment
I don't actually run it but find the web page has such a warning.
Hi, after checking on this bug, there are a few things that I noted here:
- While
torch.crossis more flexible and allows you for more complex cross products, I believe the expected behavior is usually the one fromtorch.linalg.crossimplementation. In this discussion it explains why blindly usingtorch.crosscan lead you to an intersting bug-hunting. - The function
torch.svdis deprecated and will be removed in future pytorch release.
I am submitting a PR to attempt to solve this issue and updating the tutorial.