-
Notifications
You must be signed in to change notification settings - Fork 584
fix(array-api): fix xp.where errors #4624
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
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
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.
PR Overview
This PR updates several modules to ensure compatibility with Array API 2024.12 by explicitly casting the exclude_mask to a boolean type. Key changes include applying xp.astype(exclude_mask, xp.bool) in multiple files to meet the new API requirements.
Reviewed Changes
| File | Description |
|---|---|
| deepmd/dpmodel/descriptor/repformers.py | Cast exclude_mask to boolean for proper compatibility with Array API 2024.12 |
| deepmd/dpmodel/fitting/general_fitting.py | Cast exclude_mask to boolean for proper compatibility with Array API 2024.12 |
| deepmd/dpmodel/descriptor/se_t_tebd.py | Cast exclude_mask to boolean for proper compatibility with Array API 2024.12 |
| deepmd/dpmodel/descriptor/dpa1.py | Cast exclude_mask to boolean for proper compatibility with Array API 2024.12 |
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
📝 WalkthroughWalkthroughThis pull request introduces explicit boolean type conversions for the Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
⏰ Context from checks skipped due to timeout of 90000ms (19)
🔇 Additional comments (4)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #4624 +/- ##
=======================================
Coverage 84.58% 84.58%
=======================================
Files 680 680
Lines 64543 64548 +5
Branches 3540 3539 -1
=======================================
+ Hits 54594 54600 +6
Misses 8807 8807
+ Partials 1142 1141 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
`xp.where` always requires a bool array as its first input, but previously, the array-api-strict package didn't require it. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Enhanced the internal filtering logic by standardizing type handling for exclusion conditions, ensuring more reliable and consistent operations across the system. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn> (cherry picked from commit 05ba1bf)
xp.wherealways requires a bool array as its first input, but previously, the array-api-strict package didn't require it.Summary by CodeRabbit