Skip to content

Commit fd6eea0

Browse files
update code
1 parent 742792f commit fd6eea0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

array_api_compat/paddle/_aliases.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import numpy as np
55

66
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
88

99
from ..common._aliases import (
1010
unstack as _aliases_unstack,
@@ -1036,7 +1036,7 @@ def is_complex(dtype):
10361036
paddle.framework.core.DataType.FLOAT64,
10371037
paddle.framework.core.DataType.FLOAT16,
10381038
paddle.framework.core.DataType.BFLOAT16,
1039-
]
1039+
]
10401040
elif kind == "complex floating":
10411041
return is_complex(dtype)
10421042
elif kind == "numeric":
@@ -1186,8 +1186,7 @@ def _isscalar(a):
11861186
if type(max) is int and max >= paddle.iinfo(x.dtype).max:
11871187
max = None
11881188

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)
11911190
if min is not None:
11921191
if paddle.is_tensor(x) and x.dtype == paddle.float64 and _isscalar(min):
11931192
# Avoid loss of precision due to paddle defaulting to float32
@@ -1203,7 +1202,7 @@ def _isscalar(a):
12031202
ib = (out > b) | paddle.isnan(b)
12041203
out[ib] = astype(b[ib], out.dtype)
12051204
# Return a scalar for 0-D
1206-
return out[()]
1205+
return out
12071206

12081207

12091208
def cumulative_sum(
@@ -1340,6 +1339,8 @@ def searchsorted(
13401339
"ones_like",
13411340
"full_like",
13421341
"asarray",
1342+
"ceil",
1343+
"floor",
13431344
]
13441345

13451346
_all_ignore = ["paddle", "get_xp"]

0 commit comments

Comments
 (0)