Skip to content

Commit c6788db

Browse files
authored
Test all supported versions of PyTorch (#124)
* Test all supported versions of PyTorch
1 parent 24179db commit c6788db

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
python-version: ["3.7", "3.8", "3.9"]
15+
pytorch-version: ["1.4.0", "1.5.1", "1.6.0", "1.7.1", "1.8", "1.9", "1.10", "1.11"]
16+
exclude:
17+
- python-version: 3.9
18+
pytorch-version: 1.6.0
19+
- python-version: 3.9
20+
pytorch-version: 1.5.1
21+
- python-version: 3.9
22+
pytorch-version: 1.4.0
1523

1624
steps:
1725
- uses: actions/checkout@v2
@@ -23,13 +31,18 @@ jobs:
2331
run: |
2432
python -m pip install --upgrade pip
2533
python -m pip install mypy pytest pytest-cov
26-
pip install -r requirements.txt
34+
pip install torch==${{ matrix.pytorch-version }} torchvision
2735
- name: mypy
36+
if: ${{ matrix.pytorch-version == '1.11' }}
2837
run: |
2938
mypy .
3039
- name: pytest
31-
if: always()
40+
if: ${{ matrix.pytorch-version == '1.11' }}
3241
run: |
3342
pytest --cov=torchinfo --cov-report= --durations=0
43+
- name: pytest
44+
if: ${{ matrix.pytorch-version != '1.11' }}
45+
run: |
46+
pytest --no-output -k "not test_eval_order_doesnt_matter and not test_google and not test_uninitialized_tensor and not test_input_size_half_precision"
3447
- name: codecov
3548
uses: codecov/codecov-action@v1

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Torchinfo provides information complementary to what is provided by `print(your_
1515

1616
This is a completely rewritten version of the original torchsummary and torchsummaryX projects by @sksq96 and @nmhkahn. This project addresses all of the issues and pull requests left on the original projects by introducing a completely new API.
1717

18+
Supports PyTorch versions 1.4.0+.
19+
1820
# Usage
1921

2022
```

0 commit comments

Comments
 (0)