Implementing unpooling in pytorch

I am trying to implement the fcn paper which performs unpooling in the deconvolution part, I am not exactly sure how to go about this, I know that when performing max_pooling we can save the indices using the return_index =True ,but i’m not sure what to do from there,

Any suggestions would be really helpful,Thanks in advance,

You can just pass the returned indices to the unpooling operation as shown in this thread.
Note there was an error regarding the output size, which was solved using the output_size argument in MaxUnpool2d.

Thanks @ptrblck Ill check this out,