Skip to content

Update NonZero to slice to number of non-zero elements - #5245

Draft
CharlieL7 wants to merge 4 commits into
developfrom
nonzero_num_out
Draft

CharlieL7 wants to merge 4 commits into
developfrom
nonzero_num_out

Conversation

@CharlieL7

Copy link
Copy Markdown
Collaborator

Motivation

  • NonZero should only output the indices of nonzero values in the input.
  • Fixes accuracy of NonZero and makes it consistent with ONNX spec.

Technical Details

  • This updates the kernel to output the number of nonzero values and then uses dyn_slice to cut off the padded values.
  • Creates a symbolic output shape regardless if the input shape was static.

Changelog Category

Add a CHANGELOG.md entry for any option other than Not Applicable

    • Added: New functionality.
    • Changed: Changes to existing functionality.
    • Removed: Functionality or support that has been removed. (Compared to a previous release)
    • Optimized: Component performance that has been optimized or improved.
    • Resolved Issues: Known issues from a previous version that have been resolved.
    • Not Applicable: This PR is not to be included in the changelog.

Follow the LLVM AI Tool Use Policy for contributions using AI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant