提交 715c215a authored 作者: Iban Harlouchet's avatar Iban Harlouchet

flake8 for tensor/opt_uncanonicalize.py

上级 47255ce3
...@@ -33,7 +33,6 @@ supposed to be canonical. ...@@ -33,7 +33,6 @@ supposed to be canonical.
# TODO: intelligent merge for mul/add # TODO: intelligent merge for mul/add
# TODO: 0*x -> 0 # TODO: 0*x -> 0
import logging import logging
_logger = logging.getLogger('theano.tensor.opt')
from theano import gof from theano import gof
from theano.tensor.elemwise import CAReduce from theano.tensor.elemwise import CAReduce
...@@ -44,6 +43,8 @@ from theano.tensor.basic import (get_scalar_constant_value, ...@@ -44,6 +43,8 @@ from theano.tensor.basic import (get_scalar_constant_value,
from theano.tensor.opt import register_uncanonicalize from theano.tensor.opt import register_uncanonicalize
from theano import scalar as scal from theano import scalar as scal
_logger = logging.getLogger('theano.tensor.opt')
@register_uncanonicalize @register_uncanonicalize
@gof.local_optimizer([T._max_and_argmax]) @gof.local_optimizer([T._max_and_argmax])
...@@ -81,8 +82,8 @@ def local_max_to_min(node): ...@@ -81,8 +82,8 @@ def local_max_to_min(node):
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 if (max.owner and
isinstance(max.owner.op, CAReduce) isinstance(max.owner.op, CAReduce) and
and max.owner.op.scalar_op == scal.maximum): max.owner.op.scalar_op == scal.maximum):
neg = max.owner.inputs[0] neg = max.owner.inputs[0]
if neg.owner and neg.owner.op == T.neg: if neg.owner and neg.owner.op == T.neg:
return [CAReduce(scal.minimum, return [CAReduce(scal.minimum,
......
...@@ -58,7 +58,6 @@ whitelist_flake8 = [ ...@@ -58,7 +58,6 @@ whitelist_flake8 = [
"typed_list/tests/test_opt.py", "typed_list/tests/test_opt.py",
"typed_list/tests/test_basic.py", "typed_list/tests/test_basic.py",
"tensor/__init__.py", "tensor/__init__.py",
"tensor/opt_uncanonicalize.py",
"tensor/blas.py", "tensor/blas.py",
"tensor/extra_ops.py", "tensor/extra_ops.py",
"tensor/nlinalg.py", "tensor/nlinalg.py",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论