提交 5a3de700 authored 作者: Frederic Bastien's avatar Frederic Bastien

Correctly recur in the loop.

上级 402dcf88
...@@ -729,12 +729,16 @@ def get_scalar_constant_value(orig_v, elemwise=True, ...@@ -729,12 +729,16 @@ def get_scalar_constant_value(orig_v, elemwise=True,
try: try:
# TODO: assert joined axis is 0. # TODO: assert joined axis is 0.
length = 0 length = 0
loop = False
for joined in v.owner.inputs[0].owner.inputs[1:]: for joined in v.owner.inputs[0].owner.inputs[1:]:
ll = get_vector_length(joined) ll = get_vector_length(joined)
if idx < length + ll: if idx < length + ll:
v = joined[idx - length] v = joined[idx - length]
continue loop = True
break
length += ll length += ll
if loop:
continue
except TypeError: except TypeError:
pass pass
except ValueError: except ValueError:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论