For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo struct
BottomK
struct BottomK
Registers the mo.bottom_k graph op with the graph compiler.
Implemented traits
Methods
execute
static def execute(values: T, indices: T, input: T, k: Scalar, axis: Scalar, sorted: Scalar[DType.bool], ctx: DeviceContext)
Executes the mo.bottom_k graph op.
Args:
- values (
T): See the graph op signature. - indices (
T): See the graph op signature. - input (
T): Input tensor to reduce. - k (
Scalar): Number of elements to select. - axis (
Scalar): See the graph op signature. - sorted (
Scalar[DType.bool]): Whether to sort the selected elements. - ctx (
DeviceContext): Device context used to enqueue the kernel.
Raises:
Error: If the operation parameters are invalid.