Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/tensorpack/tensorpack
/ _device_from_int
Function
_device_from_int
tensorpack/callbacks/inference_runner.py:25–26 ·
view source on GitHub ↗
(dev)
Source
from the content-addressed store, hash-verified
23
24
25
def
_device_from_int(dev):
26
return
'/gpu:{}'
.format(dev)
if
dev >= 0
else
'/cpu:0'
27
28
29
class
InferencerToHook(tf.train.SessionRunHook):
Callers
2
__init__
Method · 0.85
__init__
Method · 0.85
Calls
1
format
Method · 0.80
Tested by
no test coverage detected