Skip to content

Commit b127ae4

Browse files
committed
adapted the inferredAlignment parameter to be now
infered alignment in bytes and not elements anymore. This also happens in getFromBuffer()
1 parent 7520742 commit b127ae4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/lib/Bindings/Python/IRAttributes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1527,7 +1527,7 @@ class PyDenseResourceElementsAttribute
15271527
if (alignment)
15281528
inferredAlignment = *alignment;
15291529
else
1530-
inferredAlignment = view->stride_ptr()[view->ndim() - 1];
1530+
inferredAlignment = static_cast<size_t>(view->stride(view->ndim() - 1) * view->itemsize());
15311531

15321532
// The userData is a nb::ndarray<nb::any_contig>* that the deleter owns.
15331533
auto deleter = [](void *userData, const void *data, size_t size,

0 commit comments

Comments
 (0)