提交 a18bf56a 编写于 作者: M Megvii Engine Team

refactor(imperative): change the default descending args of topk from False to True

GitOrigin-RevId: 7c577284463738bb60e2e14f6c27a733f1e7eace
上级 af9e1fb0
......@@ -631,11 +631,10 @@ def sort(inp: Tensor, descending: bool = False) -> Tuple[Tensor, Tensor]:
return tns, ind
@deprecated_kwargs_default("1.12", "descending", 3)
def topk(
inp: Tensor,
k: int,
descending: bool = False,
descending: bool = True,
kth_only: bool = False,
no_sort: bool = False,
) -> Tuple[Tensor, Tensor]:
......@@ -644,7 +643,7 @@ def topk(
Args:
inp: input tensor. If input tensor is 2d, each row will be sorted.
k: number of elements needed.
descending: if True, return the largest elements instead. Default: False
descending: if True, return the largest elements. Default: True
kth_only: if True, only the k-th element will be returned. Default: False
no_sort: if True, the returned elements can be unordered. Default: False
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册