-
Notifications
You must be signed in to change notification settings - Fork 4
API: remove ndarray.base #80
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this clean-up, we can also remove the .get()
method (now it's just ._tensor
(or .tensor
if you want, no need to make that member private, it's a bit unpythonic IMO) and ndarray._from_tensor(x)
can be merged into the __init__
so that we can write the more natural ndarray(t)
.
FWIW, I'd rather keep only having an argument-less W.r.t. public or private |
Note that this ndarray is not a public API but an intermediary artefact used by a compiler, so we should write it in whichever way we find easier. |
OK, thanks. Having no public API does make it easier indeed. FTR, I still believe constructing a thing from a tensor is a prime example for a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice clean-up!
f5e5eaf
to
7dced32
Compare
Base is tracked via `self._tensor._base`. Use `a.get()._base is b.get()` instead of numpy's `a.base is b`.
closes gh-47
Base tensor relationship is tracked via pytorch'es
tensor._base
already, so removendarray.base
attribute.Checking an wrapper array base becomes then
instead of numpy's
This is the second PR in the "stack" based off gh-70.
EDIT : a.get() is gone, so it's
a.tensor._base
now.closes gh-47