Yes, that looks correct. One question, in the documentation, the dimension of input is given as (seq_len, batch, input_size), so why are you creating the input chucks based on the second dimension iput.chunk(iput.size(1), dim=1). Shouldn’t that be the first dimension? Unless if you have always assumed that your input has a different shape.
But anyways, something really weird is happening, but it is hard to find it. Can you print the first 2 elements of h_t and c_t in that for loop. We need to find out when/where the difference starts.