Hey, thank you for the reply. I have tried that but it is still returning the error.
<ipython-input-4-fbc914f54837> in <module>
    215 
    216 
--> 217                         current_q_values = QValues.get_current(policy_net, states, actions)
    218                         next_q_values = QValues.get_next(target_net, next_states)
    219                         target_q_values = (next_q_values * gamma) + rewards

<ipython-input-4-fbc914f54837> in get_current(policy_net, states, actions)
    161     def get_current(policy_net, states, actions):
    162         actions = actions.squeeze()
--> 163         return policy_net(states).gather(dim=1, index=actions.unsqueeze(-1))
    164 
    165     @staticmethod

RuntimeError: Invalid index in gather at c:\a\w\1\s\tmp_conda_3.7_070024\conda\conda-bld\pytorch-cpu_1544079887239\work\aten\src\th\generic/THTensorEvenMoreMath.cpp:457```