From c6f98fa0ec9068ee93eead3beb6cce8a377f1342 Mon Sep 17 00:00:00 2001 From: onecatcn Date: Wed, 25 May 2022 16:17:29 +0800 Subject: [PATCH] fix an bug in metrics.py; test=document_fix (#42976) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR types Bug fixes PR changes Docs Describe 修复 paddle.metric.accuracy 文档,对应的中文文档修复为 https://github.com/PaddlePaddle/docs/pull/4811 the file was editted based on the discussion in the issue: INT32 Failed on paddle.metric.accuracy: https://github.com/PaddlePaddle/Paddle/issues/42845 --- python/paddle/metric/metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/paddle/metric/metrics.py b/python/paddle/metric/metrics.py index 118004088d..d399cb2052 100644 --- a/python/paddle/metric/metrics.py +++ b/python/paddle/metric/metrics.py @@ -771,7 +771,7 @@ def accuracy(input, label, k=1, correct=None, total=None, name=None): Args: input(Tensor): The input of accuracy layer, which is the predictions of network. A Tensor with type float32,float64. The shape is ``[sample_number, class_dim]`` . - label(Tensor): The label of dataset. Tensor with type int32,int64. The shape is ``[sample_number, 1]`` . + label(Tensor): The label of dataset. Tensor with type int64. The shape is ``[sample_number, 1]`` . k(int, optional): The top k predictions for each class will be checked. Data type is int64 or int32. correct(Tensor, optional): The correct predictions count. A Tensor with type int64 or int32. total(Tensor, optional): The total entries count. A tensor with type int64 or int32. -- GitLab