From 72edb126dd9582edd3d7d35772a7848c7e493b85 Mon Sep 17 00:00:00 2001
From: whs <wanghaoshuang@baidu.com>
Date: Wed, 3 Feb 2021 10:25:40 +0800
Subject: [PATCH] 1. Move darts from static to dygraph (#647) (#649)

2. Add missing api index.rst
3. Fix comment in filter_pruner
4. Update links in API docs
---
 docs/zh_cn/api_cn/{static => dygraph}/nas/darts.rst |  0
 .../api_cn/dygraph/pruners/fpgm_filter_pruner.rst   |  2 +-
 .../api_cn/dygraph/pruners/l1norm_filter_pruner.rst |  2 +-
 .../api_cn/dygraph/pruners/l2norm_filter_pruner.rst |  2 +-
 docs/zh_cn/api_cn/index.rst                         | 13 +++++++++++++
 docs/zh_cn/api_cn/static/nas/nas_index.rst          |  1 -
 paddleslim/dygraph/prune/filter_pruner.py           |  2 +-
 7 files changed, 17 insertions(+), 5 deletions(-)
 rename docs/zh_cn/api_cn/{static => dygraph}/nas/darts.rst (100%)
 create mode 100644 docs/zh_cn/api_cn/index.rst

diff --git a/docs/zh_cn/api_cn/static/nas/darts.rst b/docs/zh_cn/api_cn/dygraph/nas/darts.rst
similarity index 100%
rename from docs/zh_cn/api_cn/static/nas/darts.rst
rename to docs/zh_cn/api_cn/dygraph/nas/darts.rst
diff --git a/docs/zh_cn/api_cn/dygraph/pruners/fpgm_filter_pruner.rst b/docs/zh_cn/api_cn/dygraph/pruners/fpgm_filter_pruner.rst
index 7fc9e26e..083d2f47 100644
--- a/docs/zh_cn/api_cn/dygraph/pruners/fpgm_filter_pruner.rst
+++ b/docs/zh_cn/api_cn/dygraph/pruners/fpgm_filter_pruner.rst
@@ -3,7 +3,7 @@ FPGMFilterPruner
 
 .. py:class:: paddleslim.FPGMFilterPruner(model, inputs, sen_file=None)
 
-`源代码 <https://github.com/PaddlePaddle/PaddleSlim/blob/release/2.0.0/paddleslim/dygraph/fpgm_pruner.py>`_
+`源代码 <https://github.com/PaddlePaddle/PaddleSlim/blob/release/2.0.0/paddleslim/dygraph/prune/fpgm_pruner.py>`_
 
 用于剪裁卷积层输出通道的的剪裁器。该剪裁器按论文 `Filter Pruning via Geometric Median for Deep Convolutional Neural Networks Acceleration <https://arxiv.org/abs/1811.00250>_` 中的统计方法对单个卷积层内的 ``Filters`` 的重要性进行排序,并按指定比例剪裁掉相对不重要的 ``Filters`` 。对 ``Filters`` 的剪裁等价于剪裁卷积层的输出通道数。
 
diff --git a/docs/zh_cn/api_cn/dygraph/pruners/l1norm_filter_pruner.rst b/docs/zh_cn/api_cn/dygraph/pruners/l1norm_filter_pruner.rst
index 93b1e3e7..cf3a05fc 100644
--- a/docs/zh_cn/api_cn/dygraph/pruners/l1norm_filter_pruner.rst
+++ b/docs/zh_cn/api_cn/dygraph/pruners/l1norm_filter_pruner.rst
@@ -3,7 +3,7 @@ L1NormFilterPruner
 
 .. py:class:: paddleslim.L1NormFilterPruner(model, inputs, sen_file=None)
 
-`源代码 <https://github.com/PaddlePaddle/PaddleSlim/blob/release/2.0.0/paddleslim/dygraph/l1norm_pruner.py#L14>`_
+`源代码 <https://github.com/PaddlePaddle/PaddleSlim/blob/release/2.0.0/paddleslim/dygraph/prune/l1norm_pruner.py#L14>`_
 
 用于剪裁卷积层输出通道的的剪裁器。该剪裁器按 ``Filters`` 的 ``l1-norm`` 统计值对单个卷积层内的 ``Filters`` 的重要性进行排序,并按指定比例剪裁掉相对不重要的 ``Filters`` 。对 ``Filters`` 的剪裁等价于剪裁卷积层的输出通道数。
 
diff --git a/docs/zh_cn/api_cn/dygraph/pruners/l2norm_filter_pruner.rst b/docs/zh_cn/api_cn/dygraph/pruners/l2norm_filter_pruner.rst
index 77f3f2a2..0400fdd3 100644
--- a/docs/zh_cn/api_cn/dygraph/pruners/l2norm_filter_pruner.rst
+++ b/docs/zh_cn/api_cn/dygraph/pruners/l2norm_filter_pruner.rst
@@ -3,7 +3,7 @@ L2NormFilterPruner
 
 .. py:class:: paddleslim.L2NormFilterPruner(model, inputs, sen_file=None)
 
-`源代码 <https://github.com/PaddlePaddle/PaddleSlim/blob/release/2.0.0/paddleslim/dygraph/l2norm_pruner.py>`_
+`源代码 <https://github.com/PaddlePaddle/PaddleSlim/blob/release/2.0.0/paddleslim/dygraph/prune/l2norm_pruner.py>`_
 
 用于剪裁卷积层输出通道的的剪裁器。该剪裁器按 ``Filters`` 的 ``l2-norm`` 统计值对单个卷积层内的 ``Filters`` 的重要性进行排序,并按指定比例剪裁掉相对不重要的 ``Filters`` 。对 ``Filters`` 的剪裁等价于剪裁卷积层的输出通道数。
 
diff --git a/docs/zh_cn/api_cn/index.rst b/docs/zh_cn/api_cn/index.rst
new file mode 100644
index 00000000..b46a1f13
--- /dev/null
+++ b/docs/zh_cn/api_cn/index.rst
@@ -0,0 +1,13 @@
+.. PaddleSlim documentation master file, created by
+   sphinx-quickstart on Wed Feb  5 14:04:52 2020.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+API文档
+=======
+
+.. toctree::
+   :maxdepth: 1
+
+   dygraph/index.rst
+   static/index.rst
diff --git a/docs/zh_cn/api_cn/static/nas/nas_index.rst b/docs/zh_cn/api_cn/static/nas/nas_index.rst
index a42d781d..a632345b 100644
--- a/docs/zh_cn/api_cn/static/nas/nas_index.rst
+++ b/docs/zh_cn/api_cn/static/nas/nas_index.rst
@@ -10,4 +10,3 @@
    table_latency.md
    early_stop.rst
    one_shot_api.rst
-   darts.rst
diff --git a/paddleslim/dygraph/prune/filter_pruner.py b/paddleslim/dygraph/prune/filter_pruner.py
index 6c97bbb3..1a90e251 100644
--- a/paddleslim/dygraph/prune/filter_pruner.py
+++ b/paddleslim/dygraph/prune/filter_pruner.py
@@ -49,7 +49,7 @@ class FilterPruner(Pruner):
 
     Args:
         model(paddle.nn.Layer): The target model to be pruned.
-        inputs(list<int>): The inputs of model. It will be use in calling 'model.forward(inputs)'.
+        inputs(list<Object>): The inputs of model. It will be use in calling 'model.forward(inputs)'.
         sen_file(str, optional): The absolute path of file that stores computed sensitivities. If it is
                               set rightly, 'FilterPruner::sensitive' function can not be called anymore
                               in next step. Default: None.
-- 
GitLab