Skip to content

Commit

Permalink
fix_memory_get_item
Browse files Browse the repository at this point in the history
  • Loading branch information
rmst committed Nov 12, 2019
1 parent 7348fa6 commit 80429a0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rtrl/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def append(self, r, done, info, obs, action):
def __len__(self):
return len(self.memory)

def __getitem__(self, item):
return self.memory[item]

def sample_indices(self):
return (randint(0, len(self.memory) - 1) for _ in range(self.batchsize))

Expand Down

0 comments on commit 80429a0

Please sign in to comment.