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