diff --git a/GPy/kern/_src/kernel_slice_operations.py b/GPy/kern/_src/kernel_slice_operations.py index de4aa629..8c06d0c0 100644 --- a/GPy/kern/_src/kernel_slice_operations.py +++ b/GPy/kern/_src/kernel_slice_operations.py @@ -26,6 +26,7 @@ class KernCallsViaSlicerMeta(ParametersChangedMeta): put_clean(dct, 'psi0', _slice_psi) put_clean(dct, 'psi1', _slice_psi) put_clean(dct, 'psi2', _slice_psi) + put_clean(dct, 'psi2n', _slice_psi) put_clean(dct, 'update_gradients_expectations', _slice_update_gradients_expectations) put_clean(dct, 'gradients_Z_expectations', _slice_gradients_Z_expectations) put_clean(dct, 'gradients_qX_expectations', _slice_gradients_qX_expectations) diff --git a/GPy/util/caching.py b/GPy/util/caching.py index 196ce343..65f608bf 100644 --- a/GPy/util/caching.py +++ b/GPy/util/caching.py @@ -76,7 +76,7 @@ class Cacher(object): self.order.append(cache_id) self.cached_inputs[cache_id] = inputs for a in inputs: - if a is not None: + if a is not None and not isinstance(a, int): ind_id = self.id(a) v = self.cached_input_ids.get(ind_id, [weakref.ref(a), []]) v[1].append(cache_id) @@ -103,9 +103,9 @@ class Cacher(object): inputs = self.combine_inputs(args, kw, self.ignore_args) cache_id = self.prepare_cache_id(inputs) # 2: if anything is not cachable, we will just return the operation, without caching - if reduce(lambda a, b: a or (not (isinstance(b, Observable) or b is None)), inputs, False): - #print 'WARNING: '+self.operation.__name__ + ' not cacheable!' - #print [not (isinstance(b, Observable)) for b in inputs] + if reduce(lambda a, b: a or (not (isinstance(b, Observable) or b is None or isinstance(b,int))), inputs, False): +# print 'WARNING: '+self.operation.__name__ + ' not cacheable!' +# print [not (isinstance(b, Observable)) for b in inputs] return self.operation(*args, **kw) # 3&4: check whether this cache_id has been cached, then has it changed? try: