Use of scipy functions in pyMC3

Thank you for your answer.
Actually, I’ve already tried the decorator @as_op
However, It showed me an error message as below.

AttributeError: ‘int’ object has no attribute ‘type’

Is here something I am missing?

# In[1]:

import os
import numpy as np
import matplotlib.pyplot as plt
import pymc3 as pm
from scipy.special import expi
get_ipython().magic('matplotlib inline')


# In[2]:

Cs = 2.5E6
rb = 0.0825
Leff = 1.9
Rb = 0.162
q = 50
t = np.array([i*3600 for i in range(51)])
temp_mea = -(q/(4.0*Leff))*expi(-Cs*(rb**2)/(4.0*t*Leff)) + 6


# In[3]:

import theano
import theano.tensor as tt

from theano.compile.ops import as_op

@as_op(itypes=[tt.dscalar, tt.dvector, tt.dscalar, tt.dscalar, tt.dscalar],
       otypes=[tt.dvector])

def ils(q, t, Cs, rb, Leff):
    temp_bore = -(q/(4.0*Leff))*expi(-Cs*(rb**2)/(4.0*t*Leff))
    return temp_bore


#  In[4]:

basic_model = pm.Model()

with basic_model:

    Leff = pm.Normal('Leff', mu=1.8, sd=0.5)
    Rb = pm.Normal('Rb', mu=0.16, sd=0.1) 

    temp_cal = ils(q, t, Cs, rb, Leff) + Rb*q

    Y_obs = pm.Normal('Y_obs', mu=temp_cal, sd=0.4, observed=temp_mea)