How to unfold CNN to use BPTT?

Hello There,

I’m currently trying to write implementation to Photorealistic Video Super Resolution. However, There’s an issue that I’m facing where the writer specified that he unfolds the generator 10 times where for each time he inputs a picture from the sequence of 10 images extracted from the video and doing Backpropagation through time.

From my understanding, It’s similar to copying the generator model multiple times, accumulating the loss, and executing a single backward operation.

However, can anyone provide any links that explain how pytorch can be used to do this?
I have been struggling for multiple days without any results.