How to use mx.sym.contrib.BilinearResize2D to reshape a layer into the shape of another layer?

The width and height in mx.sym.contrib.BilinearResize2D must be fixed. What if the shape of out is not fixed? I want to make the output has the same shape with anthor layer. Ps: The input of the network always changes, are there any better solutions except always using infer_shape to predict the shape? I think it will be very slow.