提交 bdface7e authored 作者: Ricardo Vieira's avatar Ricardo Vieira 提交者: Ricardo Vieira

Fix broken check in save_mem_new_scan

Without extracting the underlying numeric value of a constant TensorVariable `length`, `stop == length` would always fail.
上级 0b632bdb
......@@ -1339,7 +1339,7 @@ def save_mem_new_scan(fgraph, node):
stop = at.extract_constant(cf_slice[0].stop)
else:
stop = at.extract_constant(cf_slice[0]) + 1
if stop == maxsize or stop == length:
if stop == maxsize or stop == at.extract_constant(length):
stop = None
else:
# there is a **gotcha** here ! Namely, scan returns an
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论