Skip to content

Commit 58bb59e

Browse files
committed
Trailing comma added
1 parent e694d17 commit 58bb59e

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

dpctl/tensor/_ctors.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ def eye(
10471047
order="C",
10481048
device=None,
10491049
usm_type="device",
1050-
sycl_queue=None
1050+
sycl_queue=None,
10511051
):
10521052
"""
10531053
eye(n_rows, n_cols = None, /, *, k = 0, dtype = None, \
@@ -1098,23 +1098,19 @@ def eye(
10981098
order=order,
10991099
device=device,
11001100
usm_type=usm_type,
1101-
sycl_queue=sycl_queue
1101+
sycl_queue=sycl_queue,
11021102
)
11031103
if k > -n_rows and k < n_cols:
11041104
# find the length of the diagonal
1105-
L = min(
1106-
n_cols,
1107-
n_rows,
1108-
n_cols-k,
1109-
n_rows+k)
1105+
L = min(n_cols, n_rows, n_cols - k, n_rows + k)
11101106
# i is the first index of diagonal, j is the last, s is the step size
11111107
if order == "C":
11121108
s = n_cols + 1
1113-
i = k if k >= 0 else n_cols*-k
1109+
i = k if k >= 0 else n_cols * -k
11141110
else:
11151111
s = n_rows + 1
1116-
i = n_rows*k if k > 0 else -k
1117-
j = i + s*(L-1) + 1
1112+
i = n_rows * k if k > 0 else -k
1113+
j = i + s * (L - 1) + 1
11181114
x[i:j:s] = 1
11191115
# copy=False ensures no wasted memory copying the array
11201116
return dpt.reshape(x, (n_rows, n_cols), order=order, copy=False)

0 commit comments

Comments
 (0)