Skip to content

Commit 5dd6a8e

Browse files
caic99ChiahsinChu
authored andcommitted
fix: Avoid setting pin_memory in tests (deepmodeling#4919)
Avoid specifying pin_memory for test DataLoaders to eliminate warnings when no accelerator is available. deepmodeling#4874 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Updated test configurations to rely on default memory pinning behavior in data loading, improving compatibility across environments. * Simplified test setup parameters to reduce potential flakiness and align with framework defaults. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent b634f34 commit 5dd6a8e

3 files changed

Lines changed: 0 additions & 3 deletions

File tree

source/tests/pt/model/test_saveload_dpa1.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ def setUp(self) -> None:
6969
batch_size=None,
7070
num_workers=0, # setting to 0 diverges the behavior of its iterator; should be >=1
7171
drop_last=False,
72-
pin_memory=True,
7372
)
7473

7574
def cycle_iterator(iterable):

source/tests/pt/model/test_saveload_se_e2_a.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ def setUp(self) -> None:
6969
batch_size=None,
7070
num_workers=0, # setting to 0 diverges the behavior of its iterator; should be >=1
7171
drop_last=False,
72-
pin_memory=True,
7372
)
7473

7574
def cycle_iterator(iterable):

source/tests/pt/test_sampler.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def test_sampler_debug_info(self) -> None:
6262
batch_size=None,
6363
num_workers=0, # setting to 0 diverges the behavior of its iterator; should be >=1
6464
drop_last=False,
65-
pin_memory=True,
6665
)
6766
with torch.device("cpu"):
6867
batch_data = next(iter(dataloader))

0 commit comments

Comments
 (0)