From 03171ed40d66ae54b794ad396d063c27b2403e25 Mon Sep 17 00:00:00 2001 From: SigureMo Date: Mon, 24 Oct 2022 17:59:04 +0800 Subject: [PATCH 1/3] remove compat API docs --- docs/api/paddle/compat/floor_division_cn.rst | 20 ----------- .../compat/get_exception_message_cn.rst | 19 ----------- docs/api/paddle/compat/long_type_cn.rst | 8 ----- docs/api/paddle/compat/round_cn.rst | 16 --------- docs/api/paddle/compat/to_bytes_cn.rst | 34 ------------------- docs/api/paddle/compat/to_text_cn.rst | 34 ------------------- 6 files changed, 131 deletions(-) delete mode 100644 docs/api/paddle/compat/floor_division_cn.rst delete mode 100644 docs/api/paddle/compat/get_exception_message_cn.rst delete mode 100644 docs/api/paddle/compat/long_type_cn.rst delete mode 100644 docs/api/paddle/compat/round_cn.rst delete mode 100644 docs/api/paddle/compat/to_bytes_cn.rst delete mode 100644 docs/api/paddle/compat/to_text_cn.rst diff --git a/docs/api/paddle/compat/floor_division_cn.rst b/docs/api/paddle/compat/floor_division_cn.rst deleted file mode 100644 index 081d804741a..00000000000 --- a/docs/api/paddle/compat/floor_division_cn.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. _cn_api_paddle_compat_floor_division: - -floor_division -------------------------------- - -.. py:function:: paddle.compat.floor_division(x, y) - -等价于 Python3 和 Python2 中的除法。 -在 Python3 中,结果为 floor(x/y)的 int 值;在 Python2 中,结果为(x/y)的值。 - -参数 -:::::::::: - - - **x** (int|float) - 被除数。 - - **y** (int|float) - 除数。 - -返回 -:::::::::: - - x//y 的除法结果 diff --git a/docs/api/paddle/compat/get_exception_message_cn.rst b/docs/api/paddle/compat/get_exception_message_cn.rst deleted file mode 100644 index 5ce10295bc9..00000000000 --- a/docs/api/paddle/compat/get_exception_message_cn.rst +++ /dev/null @@ -1,19 +0,0 @@ -.. _cn_api_paddle_compat_get_exception_message: - -get_exception_message -------------------------------- - -.. py:function:: paddle.compat.get_exception_message(exc) - -获取特定异常的错误消息 - - -参数 -:::::::::: - - - **exec** (Exception) - 获取错误消息的异常。 - -返回 -:::::::::: - - exec 的错误消息 diff --git a/docs/api/paddle/compat/long_type_cn.rst b/docs/api/paddle/compat/long_type_cn.rst deleted file mode 100644 index 23be78bb237..00000000000 --- a/docs/api/paddle/compat/long_type_cn.rst +++ /dev/null @@ -1,8 +0,0 @@ -.. _cn_api_paddle_compat_long_type: - -long_type -------------------------------- - -.. py:function:: paddle.compat.long_type() - -builtins.int 的别名 diff --git a/docs/api/paddle/compat/round_cn.rst b/docs/api/paddle/compat/round_cn.rst deleted file mode 100644 index fe77a91c9d7..00000000000 --- a/docs/api/paddle/compat/round_cn.rst +++ /dev/null @@ -1,16 +0,0 @@ -.. _cn_api_paddle_compat_round: - -round -------------------------------- - -.. py:function:: paddle.compat.round(x, d=0) - -等价于 Python3 中的 round 函数。 - -参数 -:::::::::: - - **x** (float) - 被除数。 - -返回 -:::::::::: - 浮点数 x 的四舍五入值。 diff --git a/docs/api/paddle/compat/to_bytes_cn.rst b/docs/api/paddle/compat/to_bytes_cn.rst deleted file mode 100644 index 620815464a2..00000000000 --- a/docs/api/paddle/compat/to_bytes_cn.rst +++ /dev/null @@ -1,34 +0,0 @@ -.. _cn_api_paddle_compat_to_bytes: - -to_bytes -------------------------------- - -.. py:function:: paddle.compat.to_bytes(obj, encoding='utf-8', inplace=False) - -飞桨中的所有字符串都需要用文本字符串表示。 -此函数将对象转换为具有特定编码的字节。特别是,如果对象类型是列表或集合容器,我们将迭代对象中的所有项并将其转换为字节。 - -在 Python3 中: - - 使用特定编码将 str type 对象编码为 bytes 类型。 - -在 Python2 中: - - 使用特定的编码将 unicode 类型的对象编码为 str 类型,或者只返回 object 的 8 位字符串。 - -参数 -:::::::::: - - - **obj** (unicode|str|bytes|list|set) - 要编码的对象。 - - **encoding** (str) - 对字符串进行编码的编码格式。 - - **inplace** (bool) - 是否改变原始对象或创建一个新对象。 - -返回 -:::::::::: - - obj 解码后的结果。 - -代码示例 -::::::::: - -COPY-FROM: paddle.compat.to_bytes diff --git a/docs/api/paddle/compat/to_text_cn.rst b/docs/api/paddle/compat/to_text_cn.rst deleted file mode 100644 index 8324357cd9b..00000000000 --- a/docs/api/paddle/compat/to_text_cn.rst +++ /dev/null @@ -1,34 +0,0 @@ -.. _cn_api_paddle_compat_to_text: - -to_text -------------------------------- - -.. py:function:: paddle.compat.to_text(obj, encoding='utf-8', inplace=False) - -飞桨中的所有字符串都需要用文本字符串表示。 -此函数将对象转换为不带任何编码的文本字符串。特别是,如果对象类型是列表或集合容器,我们将迭代对象中的所有项并将其转换为文本字符串。 - -在 Python3 中: - - 使用特定编码将 bytes 类型对象解码为 str 类型。 - -在 Python2 中: - - 使用特定编码将 str type 对象解码为 unicode 类型。 - -参数 -:::::::::: - - - **obj** (unicode|str|bytes|list|set) - 要解码的对象。 - - **encoding** (str) - 解码字符串的编码格式。 - - **inplace** (bool) - 是否改变原始对象或创建一个新对象。 - -返回 -:::::::::: - - obj 解码后的结果。 - -代码示例 -::::::::: - -COPY-FROM: paddle.compat.to_text From 89f634107e2609fe266d2440de380bd663ec8572 Mon Sep 17 00:00:00 2001 From: SigureMo Date: Mon, 24 Oct 2022 18:00:06 +0800 Subject: [PATCH 2/3] remove compat labels --- docs/api/api_label | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/api/api_label b/docs/api/api_label index c050b637a32..c7cbac50628 100644 --- a/docs/api/api_label +++ b/docs/api/api_label @@ -11,12 +11,6 @@ paddle.callbacks.ReduceLROnPlateau .. _api_paddle_callbacks_ReduceLROnPlateau: paddle.callbacks.Callback .. _api_paddle_callbacks_Callback: paddle.callbacks.VisualDL .. _api_paddle_callbacks_VisualDL: paddle.callbacks.ModelCheckpoint .. _api_paddle_callbacks_ModelCheckpoint: -paddle.compat.to_text .. _api_paddle_compat_to_text: -paddle.compat.to_bytes .. _api_paddle_compat_to_bytes: -paddle.compat.floor_division .. _api_paddle_compat_floor_division: -paddle.compat.get_exception_message .. _api_paddle_compat_get_exception_message: -paddle.compat.long_type .. _api_paddle_compat_long_type: -paddle.compat.round .. _api_paddle_compat_round: paddle.is_compiled_with_xpu .. _api_paddle_is_compiled_with_xpu: paddle.is_compiled_with_npu .. _api_paddle_is_compiled_with_npu: paddle.set_device .. _api_paddle_set_device: From a3e7aaf931e4a5ef605949836b41feaef0b6e0e9 Mon Sep 17 00:00:00 2001 From: SigureMo Date: Mon, 24 Oct 2022 18:03:19 +0800 Subject: [PATCH 3/3] remove compat in docs --- docs/guides/10_contribution/docs_contribution.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/guides/10_contribution/docs_contribution.md b/docs/guides/10_contribution/docs_contribution.md index b1166573e07..5cee737d5c3 100644 --- a/docs/guides/10_contribution/docs_contribution.md +++ b/docs/guides/10_contribution/docs_contribution.md @@ -51,7 +51,6 @@ Paddle 使用 clang-format 来调整 C/C++ 源代码格式,请确保 clang-for docs/api |--paddle # 存放中文 API 文档,文件名为 api_name_cn.rst,路径为暴露的路径 | |--amp -| |--compat | |--device ... | |--utils