def register_opt2(tracks, *tags, **kwargs):
 def f(local_opt):
  name = ((kwargs and kwargs.pop('name')) or local_opt.__name__)
  if isinstance(local_opt, theano.gof.DB):
   opt = local_opt
  else:
   opt = theano.gof.local_optimizer(tracks)(local_opt)
  gpu_optimizer2.register(name, opt, 'fast_run', 'gpuarray', *tags)
  return local_opt
 return f

def register_opt2 ( tracks , * tags , ** kwargs ) : def f ( local_opt ) : name = ( ( kwargs and kwargs . pop ( 'name' ) ) or local_opt . __name__ ) if isinstance ( local_opt , theano . gof . DB ) : opt = local_opt else : opt = theano . gof . local_optimizer ( tracks ) ( local_opt ) gpu_optimizer2 . register ( name , opt , 'fast_run' , 'gpuarray' , * tags ) return local_opt return f
decorator for the new graphtogpu optimizer .