Tf.contrib.resampler.resampler() alternative in PyTorch

Hi everyone,
What is the PyTorch alternative for tf.contrib.resampler.resampler. I tried to use torch.nn.functional.interpolate but it does not seem to work the same.
Thanks.

You can use grid_sample as an alternative

2 Likes

Unfortunately this is not working for me… In tensorflow, the two tensors input and grid can have different number of dimensions
for eg:
input.get_shape() = [N, H, W, C] and
grid.get_shape() = [N, dim_0, ... , dim_n, 2]

But torch.grid_sample() requires the input and grid to have the same number of dimensions.

Is there any solution to this.

My input is 4D and grid is 3D.

Thanks.