Browse Source

docs(mge/functional): fix doctest

GitOrigin-RevId: 45b6e1147e
tags/v0.4.0
Megvii Engine Team Xinran Xu 5 years ago
parent
commit
2a1e0624ab
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      python_module/megengine/functional/utils.py

+ 2
- 1
python_module/megengine/functional/utils.py View File

@@ -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.


Loading…
Cancel
Save