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

tp.Tensor constructed over np.arange() with reverse indexing gives corrupted view. #129

Closed
markkraay opened this issue Aug 20, 2024 · 2 comments

Comments

@markkraay
Copy link
Collaborator

>>> output = tp.Tensor(np.arange(10, dtype=np.int32)[8:2:-1])
>>> output
tensor([8, 9, 817, 0, 3, 0], dtype=int32, loc=cpu:0, shape=(6,))

I expect this to be fixed once create_memref_view_from_dlpack is enabled.

@Mgluhovskoi
Copy link
Collaborator

Found another similar issue with forward indexing:

>>> tp.Tensor((np.arange(10, dtype=np.int32)[2:8:2]))
tensor([2, 3, 4], dtype=int32, loc=cpu:0, shape=(3,))
>>> np.arange(10)[2:8:2]
array([2, 4, 6])

@markkraay
Copy link
Collaborator Author

Readdressed in #158

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

No branches or pull requests

2 participants