From 2a433244280a7e3f7636562103f475ad6320e55f Mon Sep 17 00:00:00 2001 From: Mike Croucher Date: Thu, 26 Feb 2015 08:52:24 +0000 Subject: [PATCH] Convert print to function for Python 3 compatibility. --- GPy/kern/_src/coregionalize.py | 4 ++-- GPy/kern/_src/stationary.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/GPy/kern/_src/coregionalize.py b/GPy/kern/_src/coregionalize.py index 291402ec..b6a3aecf 100644 --- a/GPy/kern/_src/coregionalize.py +++ b/GPy/kern/_src/coregionalize.py @@ -61,7 +61,7 @@ class Coregionalize(Kern): try: return self._K_weave(X, X2) except: - print "\n Weave compilation failed. Falling back to (slower) numpy implementation\n" + print("\n Weave compilation failed. Falling back to (slower) numpy implementation\n") config.set('weave', 'working', 'False') return self._K_numpy(X, X2) else: @@ -123,7 +123,7 @@ class Coregionalize(Kern): try: dL_dK_small = self._gradient_reduce_weave(dL_dK, index, index2) except: - print "\n Weave compilation failed. Falling back to (slower) numpy implementation\n" + print("\n Weave compilation failed. Falling back to (slower) numpy implementation\n") config.set('weave', 'working', 'False') dL_dK_small = self._gradient_reduce_weave(dL_dK, index, index2) else: diff --git a/GPy/kern/_src/stationary.py b/GPy/kern/_src/stationary.py index 06671b23..426296f7 100644 --- a/GPy/kern/_src/stationary.py +++ b/GPy/kern/_src/stationary.py @@ -165,7 +165,7 @@ class Stationary(Kern): try: self.lengthscale.gradient = self.weave_lengthscale_grads(tmp, X, X2) except: - print "\n Weave compilation failed. Falling back to (slower) numpy implementation\n" + print("\n Weave compilation failed. Falling back to (slower) numpy implementation\n") config.set('weave', 'working', 'False') self.lengthscale.gradient = np.array([np.einsum('ij,ij,...', tmp, np.square(X[:,q:q+1] - X2[:,q:q+1].T), -1./self.lengthscale[q]**3) for q in xrange(self.input_dim)]) else: @@ -214,7 +214,7 @@ class Stationary(Kern): try: return self.gradients_X_weave(dL_dK, X, X2) except: - print "\n Weave compilation failed. Falling back to (slower) numpy implementation\n" + print("\n Weave compilation failed. Falling back to (slower) numpy implementation\n") config.set('weave', 'working', 'False') return self.gradients_X_(dL_dK, X, X2) else: