Skip to content

Commit 31b9047

Browse files
author
Löffler, Hannes
committed
fixed: check for CPU
1 parent db957ed commit 31b9047

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

reinvent/runmodes/RL/run_staged_learning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def run_staged_learning(
186186
intrinsic_penalty=intrinsic_penalty,
187187
)
188188

189-
if hasattr(torch, device.type):
189+
if hasattr(torch, device.type) and device.type != "cpu":
190190
gpu = getattr(torch, device.type)
191191
free_memory, total_memory = gpu.mem_get_info()
192192
free_memory //= 1024**2

0 commit comments

Comments
 (0)