MCPcopy Create free account
hub / github.com/rlcode/reinforcement-learning / pick_device

Function pick_device

4-atari-hard/env.py:209–216  ·  view source on GitHub ↗
(arg="auto")

Source from the content-addressed store, hash-verified

207
208
209def pick_device(arg="auto"):
210 if arg != "auto":
211 return torch.device(arg)
212 if torch.cuda.is_available():
213 return torch.device("cuda")
214 if torch.backends.mps.is_available():
215 return torch.device("mps")
216 return torch.device("cpu")
217
218
219def quit_if_window_closed(env):

Callers 1

1-ppo-rnd.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected