File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 9494 - if : runner.os == 'windows'
9595 name : Install torch cpu from pytorch.org (Windows only)
9696 run : |
97- python -m pip install torch==2.4 .1 torchvision==0.19 .1+cpu --index-url https://download.pytorch.org/whl/cpu
97+ python -m pip install torch==2.5 .1 torchvision==0.20 .1+cpu --index-url https://download.pytorch.org/whl/cpu
9898 - if : runner.os == 'Linux'
9999 name : Install itk pre-release (Linux only)
100100 run : |
@@ -103,7 +103,7 @@ jobs:
103103 - name : Install the dependencies
104104 run : |
105105 python -m pip install --user --upgrade pip wheel
106- python -m pip install torch==2.4 .1 torchvision==0.19 .1
106+ python -m pip install torch==2.5 .1 torchvision==0.20 .1
107107 cat "requirements-dev.txt"
108108 python -m pip install -r requirements-dev.txt
109109 python -m pip list
@@ -155,7 +155,7 @@ jobs:
155155 # install the latest pytorch for testing
156156 # however, "pip install monai*.tar.gz" will build cpp/cuda with an isolated
157157 # fresh torch installation according to pyproject.toml
158- python -m pip install torch>=2.4 .1 torchvision
158+ python -m pip install torch>=2.5 .1 torchvision
159159 - name : Check packages
160160 run : |
161161 pip uninstall monai
Original file line number Diff line number Diff line change 1919from parameterized import parameterized
2020
2121from monai .losses import BendingEnergyLoss , GlobalMutualInformationLoss , LocalNormalizedCrossCorrelationLoss
22+ from monai .utils import set_determinism
2223from tests .test_utils import SkipIfBeforePyTorchVersion
2324
2425TEST_CASES = [
3334
3435class TestRegLossIntegration (unittest .TestCase ):
3536 def setUp (self ):
36- torch .backends .cudnn .deterministic = True
37- torch .backends .cudnn .benchmark = False
38- torch .manual_seed (0 )
37+ set_determinism (0 )
3938 self .device = torch .device ("cuda:0" if torch .cuda .is_available () else "cpu:0" )
4039
4140 def tearDown (self ):
42- torch .backends .cudnn .deterministic = False
43- torch .backends .cudnn .benchmark = True
41+ set_determinism (None )
4442
4543 @parameterized .expand (TEST_CASES )
4644 @SkipIfBeforePyTorchVersion ((1 , 9 ))
You can’t perform that action at this time.
0 commit comments