MCPcopy 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
25def _device_from_int(dev):
26 return '/gpu:{}'.format(dev) if dev >= 0 else '/cpu:0'
27
28
29class InferencerToHook(tf.train.SessionRunHook):

Callers 2

__init__Method · 0.85
__init__Method · 0.85

Calls 1

formatMethod · 0.80

Tested by

no test coverage detected