Skip to content

Commit

Permalink
Fix backward compatibility with Python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerwooo committed Nov 28, 2024
1 parent 218c462 commit a42f80c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
<sub><b>Install from GitHub source -</b></sub>

```shell
python -m pip install git+https://github.com/spencerwooo/[email protected].2
python -m pip install git+https://github.com/spencerwooo/[email protected].3
```

<sub><b>Install from Gitee mirror -</b></sub>

```shell
python -m pip install git+https://gitee.com/spencerwoo/[email protected].2
python -m pip install git+https://gitee.com/spencerwoo/[email protected].3
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion torchattack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from torchattack.vmifgsm import VMIFGSM
from torchattack.vnifgsm import VNIFGSM

__version__ = '1.0.2'
__version__ = '1.0.3'

__all__ = [
# Helper function to create an attack by its name
Expand Down
7 changes: 6 additions & 1 deletion torchattack/attack_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
from typing import Callable, Self
from typing import Callable

try:
from typing import Self
except ImportError:
from typing_extensions import Self

import torch
import torch.nn as nn
Expand Down

0 comments on commit a42f80c

Please sign in to comment.