diff --git a/rllib/agents/dqn/dqn_torch_policy.py b/rllib/agents/dqn/dqn_torch_policy.py index dbaa9a938..0d633fa06 100644 --- a/rllib/agents/dqn/dqn_torch_policy.py +++ b/rllib/agents/dqn/dqn_torch_policy.py @@ -253,7 +253,7 @@ def build_q_losses(policy: Policy, model, _, is_training=True) # Q scores for actions which we know were selected in the given state. - one_hot_selection = F.one_hot(train_batch[SampleBatch.ACTIONS], + one_hot_selection = F.one_hot(train_batch[SampleBatch.ACTIONS].long(), policy.action_space.n) q_t_selected = torch.sum( torch.where(q_t > FLOAT_MIN, q_t,