For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
bottom_k_shape
def bottom_k_shape(input: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec], k: Scalar, axis: Scalar, sorted: Scalar[DType.bool]) -> IndexList[input.static_spec.rank]
Computes the output shape for the mo.bottom_k graph op.
Args:
- βinput (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec]): Input tensor to select the bottom-k values from. - βk (
Scalar): Number of smallest elements to select alongaxis. - β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[input.static_spec.rank]: The output shape after selecting the bottom-k values along axis.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!