提交 f6278392 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

made get_constant_value work for all Second instances, not just fill

上级 71c2c38f
......@@ -494,9 +494,9 @@ def get_constant_value(v):
return get_constant_value(v.owner.inputs[0])
if isinstance(v.owner.op, Rebroadcast):
return get_constant_value(v.owner.inputs[0])
if v.owner.op == fill:
if isinstance(v.owner.op, Elemwise) and \
isinstance(v.owner.op.scalar_op, scal.Second):
shape, val = v.owner.inputs
# fill(a,b) fills the shape of 'a' filled with 'b'
return get_constant_value(val)
if isinstance(v.owner.op, scal.Second):
x, y = v.owner.inputs
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论