Hi,
Just to be sure I understand what you are trying to do:
You have an auto encoder model, a variable output and you want to apply you auto encoder iterations times to it and then backpropagate all the way through these iterations to learn an auto encoder that repetitively encodes and decodes multiple times before producing the final output? Here, your complete network is the auto encoder stacked iterations times.
When you run your model, we just keep in memory what is necessary to compute the backward pass, nothing more.
If you do not need to compute the backward pass, you can use the volatile option as follow output = Variable(torch.zeros(256,256), volatile=True) to tell pytorch that it does not need to keep the buffers for the backward. If you do so, calling .backward() on the output will obviously raise an error.