Modify ResNet to make compatible with RNN (LSTM)

How the resnet layers can be modified in Pytorch.
Suppose I want to add some more convolutions before the FC layer and want to feed the output of ResNet to the LSTM. That means the Resnet should return the

[batchsize, Features, Length]

How can we modify it ?

The most flexible way to apply your modifications would be to write a custom model and derive from ResNet as the base class.
This would allow you to add new layers in your custom model (such as the LSTM) and to modify the forward method as you want.
The resnet implementation from torchvision can be found here.

Thank you very much @ptrblck