Top-k Operators¶
Every op on this page is used the same way: construct it once, then call it. The
constructor takes what the kernel is compiled with; the call takes the tensors.
Both are documented under each op — __init__ and forward, where forward is
what runs when you call op(...).
Top-k selection¶
tileops.ops.topk_selector.TopkSelectorFwdOp
¶
__init__
¶
Build the op. Shapes and dtype are taken from the first call.
Parameters:
-
topk(int) –Manifest
params.topk,int. -
tune(bool, default:False) –Whether to autotune, applied when a kernel is first built.
forward
¶
Run the op on the inputs the manifest declares.
Parameters:
-
index_score–Input tensor, dtype
float32. -
starts–Input tensor, dtype
int32. -
ends–Input tensor, dtype
int32.
Returns:
-
Tensor–indexes, as the manifest declares.