提交 ad943410 authored 作者: Brandon T. Willard's avatar Brandon T. Willard

Move unify module import into the only LocalOptimizer that uses it

上级 bf41a645
...@@ -22,7 +22,7 @@ import numpy as np ...@@ -22,7 +22,7 @@ import numpy as np
import theano import theano
from theano import config from theano import config
from theano.gof import destroyhandler as dh from theano.gof import destroyhandler as dh
from theano.gof import graph, op, unify from theano.gof import graph, op
from theano.gof.fg import InconsistencyError from theano.gof.fg import InconsistencyError
from theano.gof.toolbox import Feature, NodeFinder from theano.gof.toolbox import Feature, NodeFinder
from theano.gof.utils import AssocList, flatten from theano.gof.utils import AssocList, flatten
...@@ -1671,6 +1671,8 @@ class PatternSub(LocalOptimizer): ...@@ -1671,6 +1671,8 @@ class PatternSub(LocalOptimizer):
constructs out_pattern and performs the replacement. constructs out_pattern and performs the replacement.
""" """
from theano.gof import unify
if get_nodes and self.get_nodes is not None: if get_nodes and self.get_nodes is not None:
for real_node in self.get_nodes(fgraph, node): for real_node in self.get_nodes(fgraph, node):
if real_node == "output": if real_node == "output":
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论