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(
672
672
_check_out_status (out , False )
673
673
ret = _C_ops .minimum (input , dim_or_other )
674
674
675
- if out is None :
676
- return ret
677
- else :
675
+ if out is not None :
678
676
if isinstance (ret , MinMaxRetType ):
679
677
paddle .assign (ret .values , out [0 ])
680
678
paddle .assign (ret .indices , out [1 ])
681
679
else :
682
680
paddle .assign (ret , out )
681
+ return ret
683
682
684
683
685
684
@ForbidKeywordsDecorator (
@@ -822,11 +821,10 @@ def max(
822
821
_check_out_status (out , False )
823
822
ret = _C_ops .maximum (input , dim_or_other )
824
823
825
- if out is None :
826
- return ret
827
- else :
824
+ if out is not None :
828
825
if isinstance (ret , MinMaxRetType ):
829
826
paddle .assign (ret .values , out [0 ])
830
827
paddle .assign (ret .indices , out [1 ])
831
828
else :
832
829
paddle .assign (ret , out )
830
+ return ret
You can’t perform that action at this time.
0 commit comments