mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-11-13 22:56:18 +00:00
refactor analysis.py
This commit is contained in:
parent
97a6e7c630
commit
cb3b01863d
Binary file not shown.
@ -145,9 +145,8 @@ class error(ValueError):
|
|||||||
|
|
||||||
def _init_device (setting, arg): #initiates computation device for ANNs
|
def _init_device (setting, arg): #initiates computation device for ANNs
|
||||||
if setting == "cuda":
|
if setting == "cuda":
|
||||||
temp = setting + ":" + str(arg)
|
|
||||||
try:
|
try:
|
||||||
return torch.device(temp if torch.cuda.is_available() else "cpu")
|
return torch.device(setting + ":" + str(arg) if torch.cuda.is_available() else "cpu")
|
||||||
except:
|
except:
|
||||||
raise error("could not assign cuda or cpu")
|
raise error("could not assign cuda or cpu")
|
||||||
elif setting == "cpu":
|
elif setting == "cpu":
|
||||||
|
Loading…
Reference in New Issue
Block a user