Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
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
182
def
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_seq
Function · 0.90
test_AFN
Function · 0.90
test_FiBiNET
Function · 0.50
test_AFM
Function · 0.50
test_DIEN
Function · 0.50
test_DCN
Function · 0.50
test_DCNMix
Function · 0.50
test_WDL
Function · 0.50
test_PNN
Function · 0.50
test_DIN
Function · 0.50
test_NFM
Function · 0.50
test_xDeepFM
Function · 0.50
Calls
no outgoing calls
Tested by
15
test_CCPM_without_seq
Function · 0.72
test_AFN
Function · 0.72
test_FiBiNET
Function · 0.40
test_AFM
Function · 0.40
test_DIEN
Function · 0.40
test_DCN
Function · 0.40
test_DCNMix
Function · 0.40
test_WDL
Function · 0.40
test_PNN
Function · 0.40
test_DIN
Function · 0.40
test_NFM
Function · 0.40
test_xDeepFM
Function · 0.40