diff --git a/rllib/policy/torch_policy.py b/rllib/policy/torch_policy.py index af6ecb86d..2aa8bd916 100644 --- a/rllib/policy/torch_policy.py +++ b/rllib/policy/torch_policy.py @@ -306,6 +306,10 @@ class TorchPolicy(Policy): if prev_reward_batch is not None: input_dict[SampleBatch.PREV_REWARDS] = prev_reward_batch seq_lens = torch.ones(len(obs_batch), dtype=torch.int32) + state_batches = [ + convert_to_torch_tensor(s, self.device) + for s in (state_batches or []) + ] # Exploration hook before each forward pass. self.exploration.before_compute_actions(explore=False)