|
def | topk_func (k=10, axis=-1, outputs=None, exclude=None) |
|
Provides functions that can apply post-processing to `IterationResult` s.
◆ topk_func()
def polygraphy.comparator.postprocess.PostprocessFunc.topk_func |
( |
|
k = 10 , |
|
|
|
axis = -1 , |
|
|
|
outputs = None , |
|
|
|
exclude = None |
|
) |
| |
|
static |
Creates a function that applies a Top-K operation to a IterationResult.
Top-K will return the indices of the k largest values in the array.
Args:
k (int):
The number of indices to keep.
If this exceeds the axis length, it will be clamped.
Defaults to 10.
axis (int):
The axis along which to apply the topk.
Defaults to -1.
outputs (Sequence[str]):
Names of outputs to apply top-k to.
Defaults to all outputs.
exclude (Sequence[str]):
Names of outputs to exclude. Top-K will not be applied to these outputs.
Returns:
Callable(IterationResult) -> IterationResult: The top-k function.
The documentation for this class was generated from the following file: