Skip to content
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

Fix/gh 649 transpose #653

Merged
merged 3 commits into from
Nov 8, 2021
Merged

Fix/gh 649 transpose #653

merged 3 commits into from
Nov 8, 2021

Conversation

oleksandr-pavlyk
Copy link
Collaborator

Closes #649

The change amounts to .T taking into account the offset. Similarly _real_view and _imag_view do that as well.

Tests added.

```

In [1]: import dpctl.tensor as dpt, itertools

In [2]: a = dpt.usm_ndarray((2,3))

In [3]: for i,j in itertools.product(range(2), range(3)): a[i, j] = i*3 + j

In [4]: dpt.to_numpy(a)[1:].T
Out[4]:
array([[3.],
       [4.],
       [5.]])

In [5]: dpt.to_numpy(a[1:].T)
Out[5]:
array([[3.],
       [4.],
       [5.]])

```
These were similar to those reported in #649
@coveralls
Copy link
Collaborator

Coverage Status

Coverage increased (+0.3%) to 74.445% when pulling d8c670a on fix/gh-649-transpose into 3d5d886 on master.

@oleksandr-pavlyk oleksandr-pavlyk merged commit 9b04a9e into master Nov 8, 2021
@oleksandr-pavlyk oleksandr-pavlyk deleted the fix/gh-649-transpose branch November 10, 2021 14:13
@PokhodenkoSA PokhodenkoSA mentioned this pull request Nov 24, 2021
2 tasks
oleksandr-pavlyk added a commit that referenced this pull request Nov 24, 2021
Expanded entry about #653
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

usm_ndarray.T returns incorrect value after slicing
4 participants