提交 7dbcf9fe authored 作者: Frederic Bastien's avatar Frederic Bastien

add comment.

上级 f176bb9c
...@@ -65,6 +65,11 @@ register_uncanonicalize(MaxAndArgmaxOptimizer(),name='MaxAndArgmaxOptimizer') ...@@ -65,6 +65,11 @@ register_uncanonicalize(MaxAndArgmaxOptimizer(),name='MaxAndArgmaxOptimizer')
@register_uncanonicalize @register_uncanonicalize
@gof.local_optimizer([T._shape]) @gof.local_optimizer([T._shape])
def local_max_to_min(node): def local_max_to_min(node):
"""
change -(max(-x)) to min
This is tested in tensor/tests/test_basic.py:test_min_max
"""
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]
if max.owner and isinstance(max.owner.op, CAReduce) and max.owner.op.scalar_op==scal.maximum: if max.owner and isinstance(max.owner.op, CAReduce) and max.owner.op.scalar_op==scal.maximum:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论