提交 2a1e0624 编写于 作者: M Megvii Engine Team 提交者: Xinran Xu

docs(mge/functional): fix doctest

GitOrigin-RevId: 45b6e1147ec72cecdd7c25de2074b498cd8abc70
上级 5d32db8a
...@@ -26,7 +26,8 @@ def _decide_comp_node_and_comp_graph(*args: mgb.SymbolVar): ...@@ -26,7 +26,8 @@ def _decide_comp_node_and_comp_graph(*args: mgb.SymbolVar):
def accuracy( def accuracy(
logits: Tensor, target: Tensor, topk: Union[int, Iterable[int]] = 1 logits: Tensor, target: Tensor, topk: Union[int, Iterable[int]] = 1
) -> Union[Tensor, Iterable[Tensor]]: ) -> Union[Tensor, Iterable[Tensor]]:
r"""Calculate the classification accuracy given predicted logits and ground-truth labels. r"""
Calculate the classification accuracy given predicted logits and ground-truth labels.
:param logits: Model predictions of shape [batch_size, num_classes], :param logits: Model predictions of shape [batch_size, num_classes],
representing the probability (likelyhood) of each class. representing the probability (likelyhood) of each class.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册