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

fix bug where return type of get_constant_value was treated as iterable

even though it is documented as being 0d
上级 697592d9
......@@ -2679,7 +2679,9 @@ def max(x, axis=None, keepdims=False):
else:
try:
const = get_scalar_constant_value(axis)
out = CAReduce(scal.maximum, list(const))(x)
assert const.dtype in discrete_dtypes
const = int(const)
out = CAReduce(scal.maximum, [const])(x)
except NotScalarConstantError:
out = max_and_argmax(x, axis)[0]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论