提交 08a9ba35 authored 作者: Ricardo Vieira's avatar Ricardo Vieira 提交者: Ricardo Vieira

Remove useless try/except

All types of axis arguments are supported by max_and_argmax
上级 89d0523c
...@@ -671,13 +671,7 @@ def max(x, axis=None, keepdims=False): ...@@ -671,13 +671,7 @@ def max(x, axis=None, keepdims=False):
# thing is supporting all user interface features, not speed. # thing is supporting all user interface features, not speed.
# Some cases can be implemented only with CAReduce. # Some cases can be implemented only with CAReduce.
# We thus prefer to use MaxAndArgmax, if possible. It does not out = max_and_argmax(x, axis)[0]
# support all axis arguments, so we may need to fall back to CAReduce.
try:
out = max_and_argmax(x, axis)[0]
except Exception:
out = Max(axis)(x)
if keepdims: if keepdims:
out = makeKeepDims(x, out, axis) out = makeKeepDims(x, out, axis)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论