topk#

hypercoil.functional.sparse.topk(tensor: Tensor, k: int, *, axis: int = -1, descending: bool = True) Tensor[source]#

Select the top k entries of a tensor and return the indices in a format compatible with the top-k sparse matrix format.