Skip to content

Commit 1370835

Browse files
Return X when src==dst for moveaxis()
1 parent aefbb9a commit 1370835

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

dpctl/tensor/_manipulation_functions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,9 @@ def moveaxis(X, source, destination):
885885
"the same number of elements"
886886
)
887887

888+
if source == destination:
889+
return X
890+
888891
ind = [n for n in range(X.ndim) if n not in source]
889892

890893
for src, dst in sorted(zip(destination, source)):

0 commit comments

Comments
 (0)