jax-js
    Preparing search index...

    Function topK

    • Returns top k values and their indices along the specified axis of operand.

      This is a stable algorithm: If two elements are equal, the lower-index element appears first.

      Parameters

      Returns [Array, Array]

      A tuple of (values, indices), where values and indices have the same shape as x, except along axis where they have size k.