Skip to content

Commit a58249a

Browse files
committed
Corrects array print to offset dtype string
1 parent 1916370 commit a58249a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dpctl/tensor/_print.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,11 @@ def _usm_ndarray_repr(x, line_width=None, precision=None, suppress=None):
316316
dtype_str = "dtype={}".format(x.dtype.name)
317317
bottom_len = len(s) - (s.rfind("\n") + 1)
318318
next_line = bottom_len + len(dtype_str) + 1 > line_width
319-
dtype_str = ",\n" + dtype_str if next_line else ", " + dtype_str
319+
dtype_str = (
320+
",\n" + " " * len(prefix) + dtype_str
321+
if next_line
322+
else ", " + dtype_str
323+
)
320324
else:
321325
dtype_str = ""
322326

0 commit comments

Comments
 (0)