analysis.py v 1.1.0.007

This commit is contained in:
ltcptgeneral 2019-09-25 14:11:20 -05:00
parent 86327e97f9
commit c32b0150bd

View File

@ -7,10 +7,12 @@
# current benchmark of optimization: 1.33 times faster # current benchmark of optimization: 1.33 times faster
# setup: # setup:
__version__ = "1.1.0.006" __version__ = "1.1.0.007"
# changelog should be viewed using print(analysis.__changelog__) # changelog should be viewed using print(analysis.__changelog__)
__changelog__ = """changelog: __changelog__ = """changelog:
1.1.0.007:
- updated _init_device()
1.1.0.006: 1.1.0.006:
- removed useless try statements - removed useless try statements
1.1.0.005: 1.1.0.005:
@ -159,13 +161,9 @@ import torch
class error(ValueError): class error(ValueError):
pass pass
def _init_device(setting, arg): # initiates computation device for ANNs def _init_device(): # initiates computation device for ANNs
if setting == "cuda": device = 'cuda:0' if torch.cuda.is_available() else 'cpu'
return torch.device(setting + ":" + str(arg) if torch.cuda.is_available() else "cpu") return device
elif setting == "cpu":
return torch.device("cpu")
else:
raise error("specified device does not exist")
@jit(forceobj=True) @jit(forceobj=True)
def load_csv(filepath): def load_csv(filepath):