'How to convert Keras LSTM model into tf.nn.rnn_cell.LSTMCell model

I have trained a LSTM model on pytorch, and converted it into Keras lstm model with set_weights method. The performance looks almost the same. However, I need to convert the model into lstm model with older tensorflow version (V1.xx), by using tf.nn.rnn_cell.LSTMCell method. What confused me was that I did not find any method that can load lstm weights from numpy like arrays. The only method I find is loading saved checkpoints, but not suitable for me. Any suggestion for me? Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source