File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,20 @@ def max(*args, **kwargs):
52
52
if use_pyboost () and has_max :
53
53
return mindspore .mint .max (* args , ** kwargs )
54
54
55
- input = kwargs .get ('input' , None ) or args [0 ]
56
- dim = kwargs .get ('dim' , None ) or args [1 ]
57
- keepdim = kwargs .get ('keepdim' , False ) or args [2 ]
55
+ input = kwargs .get ('input' , None )
56
+ dim = kwargs .get ('dim' , None )
57
+ keepdim = kwargs .get ('keepdim' , False )
58
+ if len (args ) == 1 :
59
+ input = args [0 ]
60
+ elif len (args ) == 2 :
61
+ input = args [0 ]
62
+ dim = args [1 ]
63
+ elif len (args ) == 3 :
64
+ input = args [0 ]
65
+ dim = args [1 ]
66
+ keepdim = args [2 ]
67
+ else :
68
+ raise RuntimeError (f'need 3 inputs but got { len (args )} ' )
58
69
out = ops .max (input , dim , keepdim )
59
70
if dim is None :
60
71
return out [0 ]
You can’t perform that action at this time.
0 commit comments