How can I finetune pretrained model? keras to pytorch

This is how I brought pretrained model in keras. can anyone tell me how to convert this to pytorch?
and how can I specify model input and output like the second last line?? thanks.

12