Caffe2: I just want to resize a tensor into the shape of another!

In PyTorch there is iterpolate.

I dug around the Caffe2 stack but the only thing which I could find is ResizeNearest.
Now before you suggest using another function called ResizeLike, ResizeLike's behaviour is completely different to interpolate (it kinda works like transpose)

ResizeNearest isn’t too bad, least it allows for some dynamic forms of tensor resizing which changes with respect to input shapes.

But there are 2 issues (requires some knowledge of ResizeNearest behavior)

  1. You are stuck with a resizing which always floors your output dimension
  2. You are forced to design around a constant scaling ratio

I hope this thread would be useful to many people because I’ve been trying to find a good way to go about this for a good day now…

Just thought of dynamic padding, looking into it right now.