# HG changeset patch # User James Bergstra # Date 1256251932 14400 # Node ID 7ccce98da2b6438a4bc9bedf9ee0e1d4f9c09fc6 # Parent 2418dad0130716ea809accd3ccbcf5cbe4f60711 added forget function to memo in dataset_ops.memo diff -r 2418dad01307 -r 7ccce98da2b6 pylearn/dataset_ops/memo.py --- a/pylearn/dataset_ops/memo.py Thu Oct 22 18:51:45 2009 -0400 +++ b/pylearn/dataset_ops/memo.py Thu Oct 22 18:52:12 2009 -0400 @@ -17,6 +17,10 @@ if args not in cache: cache[args] = f(*args) return cache[args] + def forget(): + for k in cache.keys(): + del cache[k] + rval.forget = forget rval.__name__ = 'memo@%s'%f.__name__ return rval