提交 798fc9d1 authored 作者: Frederic's avatar Frederic

remove duplicate code.

上级 3a74c6ae
...@@ -942,8 +942,16 @@ class LocalOptGroup(LocalOptimizer): ...@@ -942,8 +942,16 @@ class LocalOptGroup(LocalOptimizer):
def __str__(self): def __str__(self):
return getattr(self, '__name__', return getattr(self, '__name__',
('<theano.gof.opt.LocalOptGroup instance>' + ('LocalOptGroup(%s)' %
str([str(o) for o in self.opts]))) ','.join([str(o) for o in self.opts])))
def tracks(self):
t = []
for l in self.opts:
tt = l.tracks()
if tt:
t.extend(tt)
return t
def transform(self, node): def transform(self, node):
for opt in self.opts: for opt in self.opts:
......
...@@ -65,8 +65,6 @@ def test_pydotprint_variables(): ...@@ -65,8 +65,6 @@ def test_pydotprint_variables():
new_handler.setLevel(logging.DEBUG) new_handler.setLevel(logging.DEBUG)
orig_handler = theano.logging_default_handler orig_handler = theano.logging_default_handler
theano.theano_logger.removeHandler(orig_handler)
theano.theano_logger.addHandler(new_handler)
theano.theano_logger.removeHandler(orig_handler) theano.theano_logger.removeHandler(orig_handler)
theano.theano_logger.addHandler(new_handler) theano.theano_logger.addHandler(new_handler)
try: try:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论