File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -4295,15 +4295,15 @@ def reduce(
4295
4295
or np .issubdtype (var .dtype , np .number )
4296
4296
or (var .dtype == np .bool_ )
4297
4297
):
4298
- if len (reduce_dims ) == 1 :
4299
- # unpack dimensions for the benefit of functions
4300
- # like np.argmin which can't handle tuple arguments
4301
- (reduce_dims ,) = reduce_dims
4302
- elif len (reduce_dims ) == var .ndim :
4298
+ if len (reduce_dims ) == var .ndim :
4303
4299
# prefer to aggregate over axis=None rather than
4304
4300
# axis=(0, 1) if they will be equivalent, because
4305
4301
# the former is often more efficient
4306
4302
reduce_dims = None # type: ignore
4303
+ elif len (reduce_dims ) == 1 :
4304
+ # unpack dimensions for the benefit of functions
4305
+ # like np.argmin which can't handle tuple arguments
4306
+ (reduce_dims ,) = reduce_dims
4307
4307
variables [name ] = var .reduce (
4308
4308
func ,
4309
4309
dim = reduce_dims ,
You can’t perform that action at this time.
0 commit comments