提交 babdf02d authored 作者: Razvan Pascanu's avatar Razvan Pascanu

bug regarding new scalar shared variable

The extract_constant function was not aware of the new scalar shared variable and hence it did not do the right changes in that case.
上级 fb69df0c
...@@ -2866,7 +2866,8 @@ def extract_constant(x): ...@@ -2866,7 +2866,8 @@ def extract_constant(x):
x = get_constant_value(x) x = get_constant_value(x)
except Exception: except Exception:
pass pass
if isinstance(x, scal.ScalarVariable): if (isinstance(x, scal.ScalarVariable) or
isinstance(x, scal.sharedvar.ScalarSharedVariable)):
if x.owner and isinstance(x.owner.op, ScalarFromTensor): if x.owner and isinstance(x.owner.op, ScalarFromTensor):
x = x.owner.inputs[0] x = x.owner.inputs[0]
else: else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论