MCPcopy
hub / github.com/shenweichen/DeepCTR-Torch / get_device

Function get_device

tests/utils.py:182–187  ·  view source on GitHub ↗
(use_cuda=True)

Source from the content-addressed store, hash-verified

180
181
182def get_device(use_cuda=True):
183 device = 'cpu'
184 if use_cuda and torch.cuda.is_available():
185 print('cuda ready...')
186 device = 'cuda:0'
187 return device

Callers 15

test_CCPM_without_seqFunction · 0.90
test_AFNFunction · 0.90
test_FiBiNETFunction · 0.50
test_AFMFunction · 0.50
test_DIENFunction · 0.50
test_DCNFunction · 0.50
test_DCNMixFunction · 0.50
test_WDLFunction · 0.50
test_PNNFunction · 0.50
test_DINFunction · 0.50
test_NFMFunction · 0.50
test_xDeepFMFunction · 0.50

Calls

no outgoing calls

Tested by 15

test_CCPM_without_seqFunction · 0.72
test_AFNFunction · 0.72
test_FiBiNETFunction · 0.40
test_AFMFunction · 0.40
test_DIENFunction · 0.40
test_DCNFunction · 0.40
test_DCNMixFunction · 0.40
test_WDLFunction · 0.40
test_PNNFunction · 0.40
test_DINFunction · 0.40
test_NFMFunction · 0.40
test_xDeepFMFunction · 0.40