Skip to content

Commit

Permalink
fixed store_device issue (#249)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Nota <cpnota@gmail.com>
  • Loading branch information
benblack769 and cpnota committed Jun 14, 2021
1 parent 3cf3d5e commit 6707571
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions all/bodies/vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ def update(self, key, value):
x = {}
for k in self.keys():
if not k == key:
x[k] = super().__getitem__(k)
x[k] = dict.__getitem__(self, k)
x[key] = value
state = LazyState(x, device=self.device)
state.to_cache = self.to_cache
state = LazyState.from_state(x, x['observation'], self.to_cache)
return state

def to(self, device):
Expand Down
2 changes: 1 addition & 1 deletion all/memory/replay_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def store(self, state, action, next_state):
if state is None or state.done:
return
idx = self.pos
super()._add((state, action, next_state))
super().store(state, action, next_state)
self._it_sum[idx] = self._max_priority ** self._alpha
self._it_min[idx] = self._max_priority ** self._alpha

Expand Down

0 comments on commit 6707571

Please sign in to comment.