Skip to content

Commit ca921bf

Browse files
committed
Remove useless atleast_1d.
1 parent 8433894 commit ca921bf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/array_api_extra/_delegation.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,7 @@ def create_diagonal(
224224
raise ValueError(err_msg)
225225

226226
if is_torch_namespace(xp):
227-
return xp.diag_embed(
228-
atleast_nd(x, ndim=1, xp=xp), offset=offset, dim1=-2, dim2=-1
229-
)
227+
return xp.diag_embed(x, offset=offset, dim1=-2, dim2=-1)
230228

231229
if (is_dask_namespace(xp) or is_cupy_namespace(xp)) and x.ndim < 2:
232230
return xp.diag(x, k=offset)

0 commit comments

Comments
 (0)