Skip to content

Add docs for torch.chain_matmul, torch.qr, torch.range, torch.cholesky #59

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

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -110,5 +110,37 @@ This function is deprecated. Use the `torch.nn.attention.sdpa_kernel` context ma
Migration guide:
Each boolean input parameter (defaulting to true unless specified) of `sdp_kernel` corresponds to a `SDPBackened`. If the input parameter is true, the corresponding backend should be added to the input list of `sdpa_kernel`.

#### torch.chain_matmul

This function is deprecated in favor of `torch.linalg.multi_dot`.

Migration guide:
`multi_dot` accepts a list of two or more tensors whereas `chain_matmul` accepted multiple tensors as input arguments. For migration, convert the multiple tensors in argument of `chain_matmul` into a list of two or more tensors for `multi_dot`.

Example: Replace `torch.chain_matmul(a, b, c)` with `torch.linalg.multi_dot([a, b, c])`.

#### torch.cholesky

`torch.cholesky()` is deprecated in favor of `torch.linalg.cholesky()`.

Migration guide:
* `L = torch.cholesky(A)` should be replaced with `L = torch.linalg.cholesky(A)`.
* `L = torch.cholesky(A, upper=True)` should be replaced with `L = torch.linalg.cholesky(A).mH`

#### torch.qr

`torch.qr()` is deprecated in favor of `torch.linalg.qr()`.

Migration guide:
* The usage `Q, R = torch.qr(A)` should be replaced with `Q, R = torch.linalg.qr(A)`.
* The boolean parameter `some` of `torch.qr` is replaced with a string parameter `mode` in `torch.linalg.qr`. The corresponding change in usage is from `Q, R = torch.qr(A, some=False)` to `Q, R = torch.linalg.qr(A, mode="complete")`.

#### torch.range

The function `torch.range()` is deprecated as its usage is incompatible with Python's builtin range. Instead, use `torch.arange()` as it produces values in `[start, end)`.

Migration guide:
* `torch.range(start, end)` produces values in the range of `[start, end]`. But `torch.arange(start, end)` produces values in `[start, end)`. For step size of 1, migrate usage from `torch.range(start, end, 1)` to `torch.arange(start, end+1, 1)`.

## License
TorchFix is BSD License licensed, as found in the LICENSE file.