How to implement element-wise 1D interpolation in Tensorflow?
<p>I would like to apply 1D interploation to each element of a tensor in Tensorflow.</p>

<p>For example, if it is a matrix, we can use <code>interp1d</code>.</p>

<pre><code>from scipy.interpolate import interp1d
q = np.array([[2, 3], [5, 6]])   # query
x = [1, 3, 5, 7, 9]              # profile x
y = [3, 4, 5, 6, 7]              # profile y
fn = interp1d(x, y)
# fn(q) == [[ 3.5, 4.], [5., 5.5]]
</code></pre>

<p>If we have a tensor <code>q</code>,</p>

<pre><code>q = tf.placeholder(shape=[2,2], dtype=tf.float32)
</code></pre>

<p>How can I have equivalent element-wise 1D interpolation?
Could anyone help?</p>