Skip to content

Commit 08a9ba3

Browse files
committed
Remove useless try/except
All types of axis arguments are supported by max_and_argmax
1 parent 89d0523 commit 08a9ba3

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

pytensor/tensor/math.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -671,13 +671,7 @@ def max(x, axis=None, keepdims=False):
671671
# thing is supporting all user interface features, not speed.
672672
# Some cases can be implemented only with CAReduce.
673673

674-
# We thus prefer to use MaxAndArgmax, if possible. It does not
675-
# support all axis arguments, so we may need to fall back to CAReduce.
676-
677-
try:
678-
out = max_and_argmax(x, axis)[0]
679-
except Exception:
680-
out = Max(axis)(x)
674+
out = max_and_argmax(x, axis)[0]
681675

682676
if keepdims:
683677
out = makeKeepDims(x, out, axis)

0 commit comments

Comments
 (0)