-
Notifications
You must be signed in to change notification settings - Fork 45
test_iop on arithmetic operators (test_special_cases.py) #130
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
Comments
Your test script is using Python floats. The test will be using arrays (probably 0-D arrays). I'm guessing your array library prints 0-D arrays as if they were Python scalars. The error message is using the |
Thanks for getting back to me. I seem to obtain the correct result when I use 0-dim arrays too:
I also put some prints in
Corresponding python script:
It seems the |
When I set this line to |
Yep, array-api-tests/array_api_tests/test_special_cases.py Lines 1310 to 1311 in 87834dd
Maybe It's worth noting NumPy doesn't support a few special cases, namely the floordiv family of special cases. We list them in our GitHub Actions workflow array-api-tests/.github/workflows/numpy.yml Lines 51 to 74 in 87834dd
but yeah you've got some errors outside of the known ones. It's worth noting we don't reproduce them. |
OK I'll check out the ivy |
I tried to replicate the way
When I used
Let me know if I have mis-implemented the in-place operation, I have never used this before. |
Yep that's as expected.
Interesting! I'm not quite sure why these would be different, as |
On the operator page you linked me, this is what they have for the
it seems it might be necessary to set |
Ah forgot it returns. So interestingly the in-place operators do return results, but for any "mutable" target it should execute the in-place operator on the target (see In-place Operators). I wonder how mutability is exactly inferred here, as that could be what trips up running |
That's interesting. So the crucial line here is: |
Shall I make a PR by the way? |
test_iop fix: assign `res` to in-place operator function #130
For numpy, I only have
test_iop
failures for arithmetic operator methods (imul
,iadd
,ifloordiv
, etc.).Take
ifloordiv
, for example. I obtain the following test error message:However, when I run the corresponding case on a script, I obtain the expected result:
Any insight would be much appreciated 😊
The text was updated successfully, but these errors were encountered: