Skip to content

Fixes #693 : Reshape clears contiguity flags#695

Merged
oleksandr-pavlyk merged 1 commit intomasterfrom
gh693-reshape-clears-contiguity-flag
Nov 30, 2021
Merged

Fixes #693 : Reshape clears contiguity flags#695
oleksandr-pavlyk merged 1 commit intomasterfrom
gh693-reshape-clears-contiguity-flag

Conversation

@oleksandr-pavlyk
Copy link
Copy Markdown
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
Copy Markdown

@coveralls
Copy link
Copy Markdown
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
Copy Markdown

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