[RLlib] Make sure, DQN torch actions are of type=long before torch.nn.functional.one_hot() op. (#11800)

This commit is contained in:
Sven Mika
2020-11-04 18:04:03 +01:00
committed by GitHub
parent 9073e6507c
commit d6c7c7c675
+1 -1
View File
@@ -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,