Fix n-step replay

This commit is contained in:
Antonin RAFFIN 2020-09-26 15:43:01 +02:00
parent 693bfa9437
commit e6573d6c22

View file

@ -457,7 +457,7 @@ class NstepReplayBuffer(ReplayBuffer):
# Compute entropy term
# TODO: convert to pytorch tensor on the correct device
with th.no_grad():
obs = th.as_tensor(self.observations[unique_indices, :]).to(self.actor.device)
obs = th.as_tensor(self.observations[unique_indices, 0, :]).to(self.actor.device)
_, log_prob = self.actor.action_log_prob(obs)
# Memory inneficient version but fast computation