Skip to content

Commit b5b7fff

Browse files
quanvuongsoumith
authored andcommitted
Fix dim of action in q_learning tutorial (pytorch#114)
1 parent 8dc5f6b commit b5b7fff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

intermediate_source/reinforcement_q_learning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def select_action(state):
332332
steps_done += 1
333333
if sample > eps_threshold:
334334
return model(
335-
Variable(state, volatile=True).type(FloatTensor)).data.max(1)[1]
335+
Variable(state, volatile=True).type(FloatTensor)).data.max(1)[1].view(1, 1)
336336
else:
337337
return LongTensor([[random.randrange(2)]])
338338

0 commit comments

Comments
 (0)