How to upsamle a layer into the shape of another layer in the symbol api?

In pytorch, we can use:

h, w = x.size(2), x.size(3)
y = F.upsample(y, size=(h, w), mode='bilinear')

to upsample and make the layer y have the same shape with layer x. How to implement this function in mxnet symbol api? BilinearResize2D needs to be provided the output size and cannot dynamically change the size after upsamle. So I am confused how to to.

Hi @zhoulukuan,
I created an UpsampleBlock in Gluon in the past.

The syntax is very similar:

F.UpSampling(x, scale=self.scale, sample_type='bilinear')