Your LSTM isn’t initialised with the batch_first=True option, therefore it expects the batch dimension to be the second dimension. Whereas memory.sample() makes batches by concatenating along a new first dimension. That doesn’t answer your current question, but I think it needs checking.
Now, to answer your question. In Dqn.learn() the line
next_outputs = self.model(batch_state,(batch_hx, batch_cx))...

needs extra parentheses around batch_state,(batch_hx, batch_cx). Dqn.learn was getting three arguments, namely self, batch_state and the tuple (batch_hx, batch_cx), instead of the two it expected, namely self, and the tuple (batch_state,(batch_hx, batch_cx))