def compiled_theano_function(fn):
 @functools.wraps(fn)
 def wrapped(self):
  try:
   func = self._compiled_functions[fn.__name__]
  except (AttributeError, KeyError):
   if (not hasattr(self, '_compiled_functions')):
    self._compiled_functions = {}
   self._compiled_functions[fn.__name__] = func = fn(self)
  return func
 return property(wrapped)

def compiled_theano_function ( fn ) : @ functools . wraps ( fn ) def wrapped ( self ) : try : func = self . _compiled_functions [ fn . __name__ ] except ( AttributeError , KeyError ) : if ( not hasattr ( self , '_compiled_functions' ) ) : self . _compiled_functions = { } self . _compiled_functions [ fn . __name__ ] = func = fn ( self ) return func return property ( wrapped )
method decorator that enables lazy on-demand compilation of theano functions .