提交 b52c1470 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Remove check for unique_value in opt, it is done in get_constant_value now.

上级 639d27b0
......@@ -275,12 +275,6 @@ def local_0_dot_x(node):
except TypeError:
pass
# TODO: Integrate that into get_constant_value somehow
if isinstance(x, T.TensorConstant) and (x.tag.unique_value == 0):
replace = True
if isinstance(y, T.TensorConstant) and (y.tag.unique_value == 0):
replace = True
if replace:
constant_zero = T.constant(0, dtype=node.outputs[0].type.dtype)
if x.ndim == 2 and y.ndim == 2:
......@@ -1636,9 +1630,6 @@ def local_incsubtensor_of_allocs(node):
replace = True
except TypeError:
pass
# TODO: Integrate that into get_constant_value
if isinstance(y, T.TensorConstant) and (y.tag.unique_value == 0):
replace = True
if replace:
return [x]
......@@ -1661,19 +1652,11 @@ def local_setsubtensor_of_allocs(node):
except TypeError:
pass
if isinstance(x, T.TensorConstant) and (x.tag.unique_value is not
None):
replace_x = x.tag.unique_value
try:
replace_y = get_constant_value(y)
except TypeError:
pass
if isinstance(y, T.TensorConstant) and (y.tag.unique_value is not
None):
replace_y = y.tag.unique_value
if (replace_x == replace_y and
replace_x is not None and
replace_y is not None):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论