I want to transform one variable into another within my model, but the transformation function is not analytic. Linear interpolation based on a lookup table will do as an approximation. I can create such a function very easily in scipy,

```
f = scipy.interpolate.interp1d(x, y)
```

where `x`

and `y`

are from the lookup table. I guess I can wrap `f`

inside a Theano Op, but I also need the gradient for NUTS to sample, right? Is there an easy way to calculate this?