From 4518fe790fd4d5a25ed44080b65ac23ebb1eadcc Mon Sep 17 00:00:00 2001 From: mvindiola1 Date: Wed, 4 Nov 2020 03:33:56 -0500 Subject: [PATCH] [RLLIB] Convert torch state arrays to tensors during compute log likelihoods (#11708) --- rllib/policy/torch_policy.py | 4 ++++ 1 file changed, 4 insertions(+) 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)