4
4
import numpy as np
5
5
6
6
from functools import wraps as _wraps
7
- from builtins import all as _builtin_all , any as _builtin_any
7
+ from builtins import any as _builtin_any
8
8
9
9
from ..common ._aliases import (
10
10
unstack as _aliases_unstack ,
@@ -1036,7 +1036,7 @@ def is_complex(dtype):
1036
1036
paddle .framework .core .DataType .FLOAT64 ,
1037
1037
paddle .framework .core .DataType .FLOAT16 ,
1038
1038
paddle .framework .core .DataType .BFLOAT16 ,
1039
- ]
1039
+ ]
1040
1040
elif kind == "complex floating" :
1041
1041
return is_complex (dtype )
1042
1042
elif kind == "numeric" :
@@ -1186,8 +1186,7 @@ def _isscalar(a):
1186
1186
if type (max ) is int and max >= paddle .iinfo (x .dtype ).max :
1187
1187
max = None
1188
1188
1189
- if out is None :
1190
- out = paddle .to_tensor (broadcast_to (x , result_shape ), place = x .place )
1189
+ out = paddle .to_tensor (broadcast_to (x , result_shape ), place = x .place )
1191
1190
if min is not None :
1192
1191
if paddle .is_tensor (x ) and x .dtype == paddle .float64 and _isscalar (min ):
1193
1192
# Avoid loss of precision due to paddle defaulting to float32
@@ -1203,7 +1202,7 @@ def _isscalar(a):
1203
1202
ib = (out > b ) | paddle .isnan (b )
1204
1203
out [ib ] = astype (b [ib ], out .dtype )
1205
1204
# Return a scalar for 0-D
1206
- return out [()]
1205
+ return out
1207
1206
1208
1207
1209
1208
def cumulative_sum (
@@ -1340,6 +1339,8 @@ def searchsorted(
1340
1339
"ones_like" ,
1341
1340
"full_like" ,
1342
1341
"asarray" ,
1342
+ "ceil" ,
1343
+ "floor" ,
1343
1344
]
1344
1345
1345
1346
_all_ignore = ["paddle" , "get_xp" ]
0 commit comments