Hi,
If you want to learn this upsampling/downsampling, I think it makes sense to do it this way.
If you want classic upsampling/downsampling (with no learnable parameters), there are functions like upsample 1 available that use things like linear of bilinear sampling.