Hi ptrblck,
Thanks but I am moving it to CUDA, rite before the line where the error occurs
initial_hidden_state.requires_grad_()
initial_hidden_state.cuda()
  initial_cell_state.requires_grad_()
  initial_cell_state.cuda()
  
  state1 = self.lstm1(inputs[t], (initial_hidden_state,initial_cell_state))

I am trying your solution, but should I remove this if I do that, Or keep both.
I am having problem in understanding where we need to move it into cuda?
Thanks