mirror of
https://github.com/wassname/ray.git
synced 2026-07-11 10:49:42 +08:00
Python 2 compatibility. (#5887)
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user