IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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 function

bottom_k_shape

def bottom_k_shape(input: T, k: Scalar, axis: Scalar, sorted: Scalar[DType.bool]) -> IndexList[T.rank]

Computes the output shape for the mo.bottom_k graph op.

Args:

  • ​input (T): Input tensor to select the bottom-k values from.
  • ​k (Scalar): Number of smallest elements to select along axis.
  • ​axis (Scalar): Dimension along which to select the bottom-k elements.
  • ​sorted (Scalar[DType.bool]): Whether to sort the selected elements in ascending order.

Returns:

IndexList[T.rank]: The output shape after selecting the bottom-k values along axis.

Was this page helpful?