Skip to content

Commit 8090e95

Browse files
Clarify error message for invalid arrays strides
1 parent e2a00b2 commit 8090e95

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dpctl/tensor/_dlpack.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ cpdef to_dlpack_capsule(usm_ndarray usm_ary):
316316
stdlib.free(shape_strides_ptr)
317317
stdlib.free(dlm_tensor)
318318
raise BufferError(
319-
"to_dlpack_capsule: Could not reconstruct strides "
320-
"for non-contiguous tensor"
319+
"to_dlpack_capsule: Invalid array encountered "
320+
"when building strides"
321321
)
322322

323323
strides_ptr = <Py_ssize_t *>&shape_strides_ptr[nd]
@@ -444,8 +444,8 @@ cpdef to_dlpack_versioned_capsule(usm_ndarray usm_ary, bint copied):
444444
stdlib.free(shape_strides_ptr)
445445
stdlib.free(dlmv_tensor)
446446
raise BufferError(
447-
"to_dlpack_versioned_capsule: Could not reconstruct "
448-
"strides for non-contiguous tensor"
447+
"to_dlpack_versioned_capsule: Invalid array encountered "
448+
"when building strides"
449449
)
450450

451451
strides_ptr = <Py_ssize_t *>&shape_strides_ptr[nd]

0 commit comments

Comments
 (0)