Skip to content

Add assert that check if topk is called with a negative value for k #3176

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

Merged
merged 1 commit into from
Sep 30, 2021

Conversation

umar456
Copy link
Member

@umar456 umar456 commented Sep 29, 2021

Add checks to make sure K is greater than 0 for topk

Description

TopK fails if k is negative. This is not a proper value for TopK so we are adding assertions to make sure K is grater than 0.

Changes to Users

  • Users must make sure that k is greater than 0 for the topk function

Checklist

  • Rebased on latest master
  • Code compiles
  • Tests pass
  • [ ] Functions added to unified API
  • [ ] Functions documented

@umar456 umar456 requested a review from syurkevi September 29, 2021 19:13
@umar456 umar456 merged commit 6fbf5fb into arrayfire:master Sep 30, 2021
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.

2 participants