mirror of
https://github.com/wassname/kair_algorithms_draft.git
synced 2026-09-09 11:25:10 +08:00
Change demo file compatible to python2 (#40)
* Change demo file to python2 compatible * Add object to classes for compatibility with python2
This commit is contained in:
@@ -11,7 +11,7 @@ from algorithms.common.helper_functions import get_n_step_info
|
||||
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
||||
|
||||
|
||||
class ReplayBuffer:
|
||||
class ReplayBuffer(object):
|
||||
"""Fixed-size buffer to store experience tuples.
|
||||
|
||||
Taken from Udacity deep-reinforcement-learning github repository:
|
||||
@@ -79,7 +79,7 @@ class ReplayBuffer:
|
||||
return len(self.buffer)
|
||||
|
||||
|
||||
class NStepTransitionBuffer:
|
||||
class NStepTransitionBuffer(object):
|
||||
"""Fixed-size buffer to store experience tuples.
|
||||
|
||||
Attributes:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import operator
|
||||
|
||||
|
||||
class SegmentTree:
|
||||
class SegmentTree(object):
|
||||
""" Create SegmentTree.
|
||||
|
||||
Taken from OpenAI baselines github repository:
|
||||
|
||||
Reference in New Issue
Block a user