Python 2 compatibility. (#5887)

This commit is contained in:
Robert Nishihara
2019-10-10 19:09:25 -07:00
committed by GitHub
parent c3b2ae26c5
commit 523c764c25
12 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -113,7 +113,7 @@ def dataset_creators(use_cuda):
import torch.optim as optim
class Network():
class Network(object):
def __init__(self, lr=0.01, momentum=0.5):
use_cuda = torch.cuda.is_available()
self.device = device = torch.device("cuda" if use_cuda else "cpu")