question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TopK operator spec ambiguity

See original GitHub issue

Hello 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:closed
  • Created 4 years ago
  • Comments:20 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
jiafatomcommented, Jun 5, 2019

I don’t prefer padding inside TopK, because padding does change TopK behavior. Generally the model owner will add padding after TopK.

0reactions
hariharans29commented, Jun 5, 2019

@wschin - I see your concern. Thanks for elaborating.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found