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