We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6880cd commit 5ec9adaCopy full SHA for 5ec9ada
tests/utils/contexts.py
@@ -10,7 +10,7 @@
10
11
@contextmanager
12
def fork_rng(seed: int = 0) -> Generator[Any, None, None]:
13
- devices = [DEVICE] if DEVICE.type == "cuda" else []
+ devices = [] if DEVICE.type == "cpu" else [DEVICE]
14
with torch.random.fork_rng(devices=devices, device_type=DEVICE.type) as ctx:
15
torch.manual_seed(seed)
16
yield ctx
0 commit comments