Implementing unpooling in pytorch

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.