提交 dd81cc34 authored 作者: Frederic Bastien's avatar Frederic Bastien

fix StochasticOrder error in the buildbot. We now always do optimization in the…

fix StochasticOrder error in the buildbot. We now always do optimization in the toposort order, so they don't execute in different order.
上级 32cc45d8
...@@ -40,7 +40,7 @@ class MaxAndArgmaxOptimizer(Optimizer): ...@@ -40,7 +40,7 @@ class MaxAndArgmaxOptimizer(Optimizer):
def apply(self, env): def apply(self, env):
did_something = True did_something = True
while did_something: while did_something:
nodelist = list(env.nodes) nodelist = env.toposort()
did_something = False did_something = False
for node in nodelist: for node in nodelist:
if node.op == T._max_and_argmax: if node.op == T._max_and_argmax:
...@@ -69,6 +69,9 @@ def local_max_to_min(node): ...@@ -69,6 +69,9 @@ def local_max_to_min(node):
change -(max(-x)) to min change -(max(-x)) to min
This is tested in tensor/tests/test_basic.py:test_min_max This is tested in tensor/tests/test_basic.py:test_min_max
:note: we don't need an opt that will do the reverse as by default
the interface put only MaxAndArgmax into the graph.
""" """
if node.op == T.neg and node.inputs[0].owner: if node.op == T.neg and node.inputs[0].owner:
max = node.inputs[0] max = node.inputs[0]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论