Skip to content

Fixes #693 : Reshape clears contiguity flags #695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 30, 2021

Conversation

oleksandr-pavlyk
Copy link
Contributor

Constructor make more rigorous checks for contiguity flags.

This fixes #693

When constructor is checking contiguity of the 1D array, it needs to
account for 1-element array no matter the value of strides[0].

Similarly for higher dimensionality, contiguity check should not
take into account slots with dimensions of 1.

X1 = usm_ndarray((1,3,1), 'i4', 'device', strides=(0,1,0))
X2 = usm_ndarray((2,1,3), 'i4', 'device', strides=(3, 0, 1))
X3 = usm_ndarray((2,1,3), 'i4', 'device', strides=(1, 0, 2))

tests added.

Constructor make more rigorous checks for contiguity flags.

When constructor is checking contiguity of the 1D array, it needs to
account for 1-element array no matter the value of strides[0].

Similarly for higher dimensionality, contiguity check should not
take into account slots with dimensions of 1.

X1 = usm_ndarray((1,3,1), 'i4', 'device', strides=(0,1,0))
X2 = usm_ndarray((2,1,3), 'i4', 'device', strides=(3, 0, 1))
X3 = usm_ndarray((2,1,3), 'i4', 'device', strides=(1, 0, 2))
@github-actions
Copy link

@coveralls
Copy link
Collaborator

Coverage Status

Coverage increased (+0.08%) to 74.867% when pulling ddafefe on gh693-reshape-clears-contiguity-flag into ad06973 on master.

@oleksandr-pavlyk oleksandr-pavlyk changed the title Fixes #693 Fixes #693 : Reshape clears contiguity flags Nov 30, 2021
@oleksandr-pavlyk oleksandr-pavlyk merged commit cd85369 into master Nov 30, 2021
@oleksandr-pavlyk oleksandr-pavlyk deleted the gh693-reshape-clears-contiguity-flag branch November 30, 2021 12:51
@github-actions
Copy link

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unexpected order of array created with reshape
3 participants