From 1c7ec53682483d3749b71f5d5cc2e61b39903d68 Mon Sep 17 00:00:00 2001 From: Jiaqi Liu Date: Fri, 29 Jan 2021 15:22:39 +0800 Subject: [PATCH] Cherry pick fix acc sample code bug (#30716) * Alias from paddle.fluid.layers.auc to paddle.static.auc (#30206) * add alias from fluid.layers.auc to static.auc * Update __init__.py * add auc into all list * alias acc, expose to users * add auc into 'all' list (#30310) * add auc into 'all' list * alias acc, expose to users * update sample code * fix paddle.static.acc and auc sample code bug, test=document_fix --- python/paddle/fluid/layers/metric_op.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/paddle/fluid/layers/metric_op.py b/python/paddle/fluid/layers/metric_op.py index 69052a502c1..bf53f37a7e9 100644 --- a/python/paddle/fluid/layers/metric_op.py +++ b/python/paddle/fluid/layers/metric_op.py @@ -51,6 +51,7 @@ def accuracy(input, label, k=1, correct=None, total=None): Examples: .. code-block:: python + import numpy as np import paddle @@ -156,6 +157,7 @@ def auc(input, Examples: .. code-block:: python + import numpy as np import paddle -- GitLab