File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -672,14 +672,13 @@ def min(
672672 _check_out_status (out , False )
673673 ret = _C_ops .minimum (input , dim_or_other )
674674
675- if out is None :
676- return ret
677- else :
675+ if out is not None :
678676 if isinstance (ret , MinMaxRetType ):
679677 paddle .assign (ret .values , out [0 ])
680678 paddle .assign (ret .indices , out [1 ])
681679 else :
682680 paddle .assign (ret , out )
681+ return ret
683682
684683
685684@ForbidKeywordsDecorator (
@@ -822,11 +821,10 @@ def max(
822821 _check_out_status (out , False )
823822 ret = _C_ops .maximum (input , dim_or_other )
824823
825- if out is None :
826- return ret
827- else :
824+ if out is not None :
828825 if isinstance (ret , MinMaxRetType ):
829826 paddle .assign (ret .values , out [0 ])
830827 paddle .assign (ret .indices , out [1 ])
831828 else :
832829 paddle .assign (ret , out )
830+ return ret
You can’t perform that action at this time.
0 commit comments