Skip to content

ndarray.base : worth keeping? #47

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

Closed
ev-br opened this issue Feb 7, 2023 · 0 comments · Fixed by #80
Closed

ndarray.base : worth keeping? #47

ev-br opened this issue Feb 7, 2023 · 0 comments · Fixed by #80

Comments

@ev-br
Copy link
Collaborator

ev-br commented Feb 7, 2023

NumPy uses the .base ndarray attribute to trace the views, as in

In [77]: a = np.arange(10)

In [78]: a[::2].base is a
Out[78]: True

In [79]: a[::2].copy().base is a
Out[79]: False

It's been suggested (#46 (comment)) to drop this, because PyTorch tracks views vs copies in a private Tensor._base attribute.

While there is no way to restore the pubic base from private _tensor._base, the question is whether we want/need to keep the .base on the ndarray wrapper level.

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 a pull request may close this issue.

1 participant