Thank you. Those examples are some of the first online I’ve seen that are updated to 1.5.0+'s API for RNNs.   It also reminded me my handing of the hidden state was slightly off,in that in the python code we has been doing other experiments where we were preserving the RNN hidden states so we could restart in the middle of a sequence.  Your examples of course just ignore the hidden state which is what I want here. Link to your RNN example: https://github.com/prabhuomkar/pytorch-cpp/blob/master/tutorials/intermediate/recurrent_neural_network/src/rnn.cpp 8 .
Note that the second link you gave is for a CNN, not an RNN (and I was already very familiar with it).