From 82a25d691b8f614b3cbccee1d2e0d95b0a5afd50 Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Fri, 28 Feb 2014 12:08:16 +0000 Subject: [PATCH] fixed caching bug with args having Nones --- GPy/util/caching.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GPy/util/caching.py b/GPy/util/caching.py index a2017407..250efe11 100644 --- a/GPy/util/caching.py +++ b/GPy/util/caching.py @@ -1,4 +1,5 @@ from ..core.parameterization.parameter_core import Observable +import itertools class Cacher(object): """ @@ -40,9 +41,9 @@ class Cacher(object): # TODO: WARNING !!! Cache OFFSWITCH !!! WARNING # return self.operation(*args) - + #if the result is cached, return the cached computation - state = [all(a is b for a, b in zip(args, cached_i)) for cached_i in self.cached_inputs] + state = [all(a is b for a, b in itertools.izip_longest(args, cached_i)) for cached_i in self.cached_inputs] if any(state): i = state.index(True) if self.inputs_changed[i]: