Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build:

requirements:
host:
- python>=3.9
- python>=3.10
- setuptools
run:
- numpy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-conda-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
tests:
strategy:
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12"]
python_version: ["3.10", "3.11", "3.12"]
fail-fast: false
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-pip-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
pytorch_args: ["-v 2.3.0", "-v 2.4.0", "-v 2.5.0", "-v 2.6.0", "-v 2.7.0"]
transformers_args: ["-t 4.38.0", "-t 4.39.0", "-t 4.41.0", "-t 4.43.0", "-t 4.45.2"]
docker_img: ["cimg/python:3.9", "cimg/python:3.10", "cimg/python:3.11", "cimg/python:3.12"]
docker_img: ["cimg/python:3.10", "cimg/python:3.11", "cimg/python:3.12"]
fail-fast: false
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
with:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Github Actions will fail on your PR if it does not adhere to the ufmt or flake8

#### Type Hints

Captum is fully typed using Python 3.9+
Captum is fully typed using Python 3.10+
[type hints](https://www.python.org/dev/peps/pep-0484/).
We expect any contributions to also use proper type annotations, and we enforce
consistency of these in our continuous integration tests.
Expand All @@ -63,7 +63,7 @@ Then run this script from the repository root:
```
Note that we expect mypy to have version 0.760 or higher, and when type checking, use PyTorch 1.10 or
higher due to fixes to the PyTorch type hints available. We also use the Literal feature which is
available only in Python 3.9 or above.
available only in Python 3.10 or above.

We also use [pyre](https://pyre-check.org/) for type checking. For contributors, the nightly version of
pyre is used which can be installed with pip `pip install pyre-check-nightly`. To run pyre, you can
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Captum can also be used by application engineers who are using trained models in
## Installation

**Installation Requirements**
- Python >= 3.9
- Python >= 3.10
- PyTorch >= 2.3


Expand Down
6 changes: 1 addition & 5 deletions captum/_utils/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@
# pyre-ignore[24]: Generic type `slice` expects 3 type parameters.
SliceIntType = slice # type: ignore

# Necessary for Python >=3.7 and <3.9!
if TYPE_CHECKING:
BatchEncodingType = UserDict[Union[int, str], object]
else:
BatchEncodingType = UserDict
BatchEncodingType = UserDict[Union[int, str], object]


class TokenizerLike(Protocol):
Expand Down
Loading
Loading