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