Your code looks good, since _upsample_like onle uses the functional API via F.upsample without any parameters.
You could of course create an nn.Upsample module, but this wouldn’t make a difference and I think your current code is clear and shouldn’t be changed. I’ll take a look at the linked issue.