-
Notifications
You must be signed in to change notification settings - Fork 53
Explicitly specify which categories of dtypes the elementwise functions are defined for #121
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
…ns are defined for
Thanks Aaron. This categorization makes sense, and I agree with "must" -> "should". |
This seems correct to me. Most libraries will happily accept integer dtypes and upcast to float, but IIRC at least TensorFlow raises an exception instead. +1 for the
|
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.
Caught two typos while digesting the changes 🙂
The special case of
|
Re:
Ditto for If the goal is to match Python 3 |
Co-authored-by: Leo Fang <leofang@bnl.gov>
…is/array-api into elementwise-data-type-categories
I made |
Co-authored-by: Athan <kgryte@gmail.com>
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.
Can you do this follow-up @asmeurer? |
Please double check that I didn't make any mistakes.
Some comments:
pow
,pow(a, b)
does not make sense ifa
andb
are integers andb
is negative. Should we restrict it to only being defined for nonnegativeb
? I think I might have brought this up before somewhere, but I don't remember what was decided.pow(0, 0) == 1
be listed as a special case forpow
?)divide
. Should it be defined for integer inputs, and if so, does that preclude the definition when the second argument is 0?I will also update the array methods as per #98 (comment) in another PR once this is merged.