-
Notifications
You must be signed in to change notification settings - Fork 4
RFC #112
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.
Thanks Mario! Here are my first set of high-level comments that seem worth discussing.
RFC.md
Outdated
w = z.sum() | ||
``` | ||
|
||
Here we already see a couple differences between NumPy and PyTorch. The most |
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.
I'd suggest to move a summary of differences to a section nearer to the end of the document, and forward-reference it here. It reads better if we focus on the main use case and 95% where behavior is matching.
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.
I pushed some changes. I think that leaving these in this example and moving the FKA ## DTypes
section right after this section makes these points here have more meaning.
This is how I had it at the beginning, which makes more sense, but then I moved the dtypes section down the document and left this part a bit on its own.
RFC.md
Outdated
keyword-only argument. It is for this reason that, in PrimTorch, we were able | ||
to implement it as | ||
[a decorator](https://github.com/pytorch/pytorch/blob/ce4df4cc596aa10534ac6d54912f960238264dfd/torch/_prims_common/wrappers.py#L187-L282). | ||
This is not the case in NumPy. In NumPy `out` is a positional arg that is often |
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.
That's going on my list of things to fix for NumPy 2.0:)
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.
Not sure what I meant two weeks ago, but this isn't true:
>>> x = np.ones(3)
>>> np.sin(x, x)
array([0.84147098, 0.84147098, 0.84147098])
>>> x = np.ones(3)
>>> np.sin(x, out=x)
array([0.84147098, 0.84147098, 0.84147098])
I'll change this to "can be used both as a positional and a keyword argument".
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.
yep, I meant "In NumPy, out
can be specified as a positional arg"
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.
A few minor comments on a first read-through.
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.
This reads great. Several minor comments, all optional.
RFC.md
Outdated
|
||
|
||
The this project has a main goal as per the | ||
[initial design document](https://docs.google.com/document/d/1gdUDgZNbumFORRcUaZUVw790CtNYweAM20C1fbWMNd8): |
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.
The access is gated.
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.
I'll try to fix that by upstreaming the relevant content here. Best for this RFC to be standalone.
Addressed the last review. Once @rgommers does a last pass, we'll publish this one in the RFC repo. |
I left a number of comments in bold throughout the text that occurred to me as I was writing this.