-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[lang] Broken ti.math.sign implementations #8077
Labels
bug
We've confirmed that this is an BUG
Comments
Took a quick look that it seems to be related to we feed a |
ailzhang
pushed a commit
that referenced
this issue
May 26, 2023
Issue: #8077 ### Brief Summary <!-- copilot:summary --> ### <samp>🤖 Generated by Copilot at 5c77628</samp> Fix `sign` function bug for negative values and add unit test. The bug caused `sign` to return wrong signs for negative values on LLVM and causes crashes on gfx. The unit test checks `sign` for various inputs in `test_unary_ops.py`. ### Walkthrough <!-- copilot:walkthrough --> ### <samp>🤖 Generated by Copilot at 5c77628</samp> * Fix bug in `sign` function that caused incorrect results or crashes for negative values ([link](https://github.com/taichi-dev/taichi/pull/8082/files?diff=unified&w=0#diff-5b3923516b48467202850afb384ef9901ecefae0173f03bcc9055adffe96d738L276-R276)) * Add unit test for `sign` function to verify its behavior for positive, negative, and zero values ([link](https://github.com/taichi-dev/taichi/pull/8082/files?diff=unified&w=0#diff-8ac29975a96f4251587f71dff241aa3724d26d4fcbf7b757901076205924bba5R145-R155))
Closing via #8082, thanks @listerily ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Under LLVM backends, prints:
Under GFX backends, crash with
The text was updated successfully, but these errors were encountered: