AdaptiveMaxPool2d and MaxUnpool2d

Hi everyone,

recently I was wondering how AdaptiveMaxPool2d and MaxUnpooling2d could be working together if the inputs are of variyng sizes. In the documentation it says that AdaptiveMaxPool2d can also return indices for later unpooling but how do one determines the kernel sizes and strides for the MaxUnpool2d to work? Does one has to calculate the values from the input dynamically and if yes how would you do it?

I would love to hear some thoughts on that.
Thank you very much.