Function marian::topk¶
Defined in File expression_operators.cpp
Function Documentation¶
-
Expr2
marian
::
topk
(Expr a, int k, int axis, bool descending = true)¶ Returns top k elements of an expression along an axis.
Return a 2-tuple (values, indices) of the
k
largest, or smallest, elements of an expression along a specifiedaxis
. The output is ordered according to the value ofdescending
.- Return
An ordered 2-tuple of Expressions
- Parameters
a
: Expression to searchk
: Number of elements to returnaxis
: Axis to along which to operatedescending
: If true, consider the largest elements. Otherwise, consider the smallest elements. Default is true.