Skip to content

Commit

Permalink
Fix pytorch versions CI failures
Browse files Browse the repository at this point in the history
  • Loading branch information
vfdev-5 authored Oct 2, 2024
1 parent c3bc44f commit 9532d1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/pytorch-version-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,8 @@ jobs:
matrix:
python-version: [3.8, 3.9, "3.10"]
pytorch-version:
[2.3.1, 2.2.2, 2.1.2, 2.0.1, 1.13.1, 1.12.1, 1.10.0, 1.8.1, 1.5.1]
[2.3.1, 2.2.2, 2.1.2, 2.0.1, 1.13.1, 1.12.1, 1.10.0, 1.8.1]
exclude:
- pytorch-version: 1.5.1
python-version: 3.9
- pytorch-version: 1.5.1
python-version: "3.10"

# disabling python 3.9 support with PyTorch 1.7.1 and 1.8.1, to stop repeated pytorch-version test fail.
# https://github.com/pytorch/ignite/issues/2383
- pytorch-version: 1.8.1
Expand Down Expand Up @@ -72,6 +67,13 @@ jobs:
shell: bash -l {0}
run: |
conda install pytorch=${{ matrix.pytorch-version }} torchvision cpuonly python=${{ matrix.python-version }} -c pytorch
# We should install numpy<2.0 for pytorch<2.3
numpy_one_pth_version=$(python -c "import torch; print(float('.'.join(torch.__version__.split('.')[:2])) < 2.3)")
if [ "${numpy_one_pth_version}" == "True" ]; then
pip install -U "numpy<2.0"
fi
pip install -r requirements-dev.txt
python setup.py install
Expand Down
1 change: 1 addition & 0 deletions ignite/metrics/hsic.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def update(self, output: Sequence[Tensor]) -> None:

vx: Union[Tensor, float]
if self.sigma_x < 0:
# vx = torch.quantile(dxx, 0.5)
vx = torch.quantile(dxx, 0.5)
else:
vx = self.sigma_x**2
Expand Down

0 comments on commit 9532d1e

Please sign in to comment.