Skip to content

Document TOR004,TOR102,TOR103 and add torch.symeig to TOR001 #65

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 1 commit into from
Aug 16, 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
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,36 @@ To get the LU factorization see `torch.lu`, which can be used with `torch.lu_sol

`X = torch.solve(B, A).solution` should be replaced with `X = torch.linalg.solve(A, B)`.

#### torch.symeig

This function was deprecated since PyTorch version 1.9 and is now removed.

`torch.symeig` is deprecated in favor of `torch.linalg.eigh`.

The default behavior has changed from using the upper triangular portion of the matrix by default to using the lower triangular portion.

```python
L, _ = torch.symeig(A, upper=upper)
```

should be replaced with

```python
L = torch.linalg.eigvalsh(A, UPLO='U' if upper else 'L')
```

and

```python
L, V = torch.symeig(A, eigenvectors=True)
```

should be replaced with

```python
L, V = torch.linalg.eigh(A, UPLO='U' if upper else 'L')
```

### TOR002 Likely typo `require_grad` in assignment. Did you mean `requires_grad`?

This is a common misspelling that can lead to silent performance issues.
Expand All @@ -81,6 +111,10 @@ from `True` to `False`. In the meantime, the value needs to be passed explicitly
See this [forum post](https://dev-discuss.pytorch.org/t/bc-breaking-update-to-torch-utils-checkpoint-not-passing-in-use-reentrant-flag-will-raise-an-error/1745)
for details.

### TOR004 Import of removed function

See `TOR001`.

### TOR101 Use of deprecated function

#### torch.nn.utils.weight_norm
Expand Down Expand Up @@ -142,5 +176,14 @@ The function `torch.range()` is deprecated as its usage is incompatible with Pyt
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)`.

### TOR102 `torch.load` without `weights_only` parameter is unsafe.

Explicitly set `weights_only` to False only if you trust the data you load and full pickle functionality is needed, otherwise set `weights_only=True`.

### TOR103 Import of deprecated function

See `TOR101`.

## License

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