TopK operator spec ambiguity
See original GitHub issueHello all,
The current TopK operator is unclear as to whether the value of k can be larger than the total number of elements in a particular axis and if so can a backend still proceed with the operation by performing k = min(k, number_of_elements) or if it has to strictly expect that the number of elements be greater than or equal to k.
We propose going with k = min(k, number_of_elements) approach (and clarifying this in the spec) as sometimes the caller doesn’t know the exact number of elements in an axis (number of objects detected for example) and k itself is usually configured to be a specific value.
Any input will be appreciated. Thanks!
CC: @jiafatom
Issue Analytics
- State:
- Created 4 years ago
- Comments:20 (20 by maintainers)
Top Results From Across the Web
UInt64 comparison operators ambiguity #2322 - GitHub
Using comparison operators (>, < , etc…) between UInt64 type and any signed type like sbyte , short, int and long causes ambiguity...
Read more >Lesson 1.4: Disambiguating Parses - K Framework
As a result, when an ambiguity occurs and one or more of the possible parses has that symbol at the top of the...
Read more >Ambiguous PEMDAS - Harvard Mathematics Department
In other words, the lack of an operator symbol implies that the relationship between them takes precedence over any operations outside, i.e. 5ab...
Read more >Ambiguities in Java - GeeksforGeeks
Ambiguity errors occur when erasure causes two seemingly distinct generic declarations to resolve to the same erased type, causing a conflict.
Read more >The Go Programming Language Specification
Repetition = "{" Expression "}" . Productions are expressions constructed from terms and the following operators, in increasing precedence: | ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I don’t prefer padding inside
TopK, because padding does changeTopKbehavior. Generally the model owner will add padding afterTopK.@wschin - I see your concern. Thanks for elaborating.