MCPcopy Index your code
hub / github.com/rlcode/reinforcement-learning / pick_device

Function pick_device

3-atari/env.py:113–120  ·  view source on GitHub ↗
(arg="auto")

Source from the content-addressed store, hash-verified

111
112
113def pick_device(arg="auto"):
114 if arg != "auto":
115 return torch.device(arg)
116 if torch.cuda.is_available():
117 return torch.device("cuda")
118 if torch.backends.mps.is_available():
119 return torch.device("mps")
120 return torch.device("cpu")
121
122
123def quit_if_window_closed(env):

Callers 2

2-ppo.pyFile · 0.90
1-dqn.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected