I have successfully performed 2d interpolation in python using the RectBivariateSpline method from scipy.interpolate. However, it is performed on numpy arrays. I want to perform it on tensors solely using tensorflow.
This is what I have right now: It works if all are numpy arrays. However, I am having a hard time to rewrite it in tensorflow.
x_old = np.arange(0,256)
y_old = np.arange(0,256)
#x = tensor of shape [256,256]
#y = tensor of shape [256,256]
#in_im = tensor of shape [256,256,3]
#out_im = tensor of shape [256,256,3]
for d in range(0,3):
interpf = RectBivariateSpline( x_old, y_old, in_im[:,:,d])
out_im[:,:,d] = interpf.ev(x[:,:], y[:,:])