Skip to content

Commit 080a96a

Browse files
committed
Update dpnp.diagonal to explicitly call dpnp_array constructor
1 parent 542b599 commit 080a96a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

dpnp/dpnp_iface_indexing.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -622,14 +622,8 @@ def diagonal(a, offset=0, axis1=0, axis2=1):
622622
out_strides = a_straides[:-2] + (1,)
623623
out_offset = a_element_offset
624624

625-
return dpnp_array._create_from_usm_ndarray(
626-
dpt.usm_ndarray(
627-
out_shape,
628-
dtype=a.dtype,
629-
buffer=a.get_array(),
630-
strides=out_strides,
631-
offset=out_offset,
632-
)
625+
return dpnp_array(
626+
out_shape, buffer=a, strides=out_strides, offset=out_offset
633627
)
634628

635629

0 commit comments

Comments
 (0)