Skip to content

Commit 63cf152

Browse files
authored
Add docs for torch.chain_matmul, torch.qr, torch.range, torch.cholesky (#59)
Partially addresses #56 Added `TOR101` deprecation doc for `torch.cholesky`, `torch.chain_matmul`, `torch.qr`, `torch.range`.
1 parent f3dd694 commit 63cf152

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,37 @@ This function is deprecated. Use the `torch.nn.attention.sdpa_kernel` context ma
110110
Migration guide:
111111
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`.
112112

113+
#### torch.chain_matmul
114+
115+
This function is deprecated in favor of `torch.linalg.multi_dot`.
116+
117+
Migration guide:
118+
`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`.
119+
120+
Example: Replace `torch.chain_matmul(a, b, c)` with `torch.linalg.multi_dot([a, b, c])`.
121+
122+
#### torch.cholesky
123+
124+
`torch.cholesky()` is deprecated in favor of `torch.linalg.cholesky()`.
125+
126+
Migration guide:
127+
* `L = torch.cholesky(A)` should be replaced with `L = torch.linalg.cholesky(A)`.
128+
* `L = torch.cholesky(A, upper=True)` should be replaced with `L = torch.linalg.cholesky(A).mH`
129+
130+
#### torch.qr
131+
132+
`torch.qr()` is deprecated in favor of `torch.linalg.qr()`.
133+
134+
Migration guide:
135+
* The usage `Q, R = torch.qr(A)` should be replaced with `Q, R = torch.linalg.qr(A)`.
136+
* 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")`.
137+
138+
#### torch.range
139+
140+
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)`.
141+
142+
Migration guide:
143+
* `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)`.
144+
113145
## License
114146
TorchFix is BSD License licensed, as found in the LICENSE file.

0 commit comments

Comments
 (0)