Skip to content

Commit 26107bf

Browse files
No need to create temporary lists
1 parent 4c5b1d1 commit 26107bf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dpctl/tensor/_manipulation_functions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ def permute_dims(X, axes):
5252
"The values of the axes must be in the range "
5353
f"from 0 to {X.ndim} and have no duplicates."
5454
)
55-
newstrides = [X.strides[i] for i in axes]
56-
newshape = [X.shape[i] for i in axes]
55+
newstrides = tuple(X.strides[i] for i in axes)
56+
newshape = tuple(X.shape[i] for i in axes)
5757
return dpt.usm_ndarray(
58-
shape=tuple(newshape),
58+
shape=newshape,
5959
dtype=X.dtype,
6060
buffer=X,
61-
strides=tuple(newstrides),
61+
strides=newstrides,
6262
offset=X.__sycl_usm_array_interface__.get("offset", 0),
6363
)

0 commit comments

Comments
 (0)