From 35aec1c6d0a5ee4749972dba2e4bbc06a06fa53b Mon Sep 17 00:00:00 2001 From: Mike Croucher Date: Tue, 3 Mar 2015 20:47:09 +0000 Subject: [PATCH] Various Python 3 fixes --- GPy/core/parameterization/parameter_core.py | 2 +- GPy/util/linalg.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GPy/core/parameterization/parameter_core.py b/GPy/core/parameterization/parameter_core.py index bfe325a3..195a80c1 100644 --- a/GPy/core/parameterization/parameter_core.py +++ b/GPy/core/parameterization/parameter_core.py @@ -581,7 +581,7 @@ class Indexable(Nameable, Updateable): if len(transforms) == 0: transforms = which.properties() removed = np.empty((0,), dtype=int) - for t in transforms: + for t in list(transforms): unconstrained = which.remove(t, self._raveled_index()) removed = np.union1d(removed, unconstrained) if t is __fixed__: diff --git a/GPy/util/linalg.py b/GPy/util/linalg.py index ec66cc09..2813a30a 100644 --- a/GPy/util/linalg.py +++ b/GPy/util/linalg.py @@ -362,7 +362,7 @@ def tdot_blas(mat, out=None): A = mat.ctypes.data_as(ctypes.c_void_p) BETA = c_double(0.0) C = out.ctypes.data_as(ctypes.c_void_p) - LDC = c_int(np.max(out.strides) / 8) + LDC = c_int(np.max(out.strides) // 8) dsyrk(byref(UPLO), byref(TRANS), byref(N), byref(K), byref(ALPHA), A, byref(LDA), byref(BETA), C, byref(LDC)) @@ -389,7 +389,7 @@ def DSYR_blas(A, x, alpha=1.): """ N = c_int(A.shape[0]) LDA = c_int(A.shape[0]) - UPLO = c_char('l') + UPLO = c_char('l'.encode('ascii')) ALPHA = c_double(alpha) A_ = A.ctypes.data_as(ctypes.c_void_p) x_ = x.ctypes.data_as(ctypes.c_void_p)