weave ObsArray bugfix

This commit is contained in:
James Hensman 2014-10-17 11:18:31 +01:00
parent b8f2b20158
commit e12329c626

View file

@ -248,7 +248,6 @@ class Stationary(Kern):
tmp = tmp + tmp.T tmp = tmp + tmp.T
X2 = X X2 = X
ret = np.zeros(X.shape)
code = """ code = """
int n,q,d; int n,q,d;
double retnd; double retnd;
@ -262,9 +261,12 @@ class Stationary(Kern):
} }
} }
""" """
from scipy import weave if hasattr(X, 'values'):X = X.values #remove the GPy wrapping to make passing into weave safe
if hasattr(X2, 'values'):X2 = X2.values
ret = np.zeros(X.shape)
N,D = X.shape N,D = X.shape
Q = tmp.shape[1] Q = tmp.shape[1]
from scipy import weave
weave.inline(code, ['ret', 'N', 'D', 'Q', 'tmp', 'X', 'X2'], type_converters=weave.converters.blitz) weave.inline(code, ['ret', 'N', 'D', 'Q', 'tmp', 'X', 'X2'], type_converters=weave.converters.blitz)
return ret/self.lengthscale**2 return ret/self.lengthscale**2