From 8da0785b26f72f797c6fa9963449ea27fc7d508c Mon Sep 17 00:00:00 2001 From: Nicolo Fusi Date: Wed, 17 Jul 2013 17:13:28 +0100 Subject: [PATCH] fixed logic for fast_array_equal --- GPy/util/misc.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/GPy/util/misc.py b/GPy/util/misc.py index 5b3a70da..f931ae6a 100644 --- a/GPy/util/misc.py +++ b/GPy/util/misc.py @@ -86,7 +86,11 @@ def fast_array_equal(A, B): value = False - if A is not None and B is not None and A.shape == B.shape: + if (A == None) and (B == None): + return True + elif ((A == None) and (B != None)) or ((A != None) and (B == None)): + return False + elif A.shape == B.shape: if len(A.shape) == 2: N, D = A.shape value = weave.inline(code, support_code=support_code, libraries=['gomp'], @@ -95,7 +99,6 @@ def fast_array_equal(A, B): else: value = np.array_equal(A,B) - return value