diff --git a/ci_scripts/check_api_label_cn.py b/ci_scripts/check_api_label_cn.py index fe278dbaa72..fd18576c1b1 100644 --- a/ci_scripts/check_api_label_cn.py +++ b/ci_scripts/check_api_label_cn.py @@ -25,7 +25,8 @@ def check_api_label(rootdir, file): real_file = Path(rootdir) / file with real_file.open("r", encoding="utf-8") as f: first_line = f.readline().strip() - return first_line == generate_en_label_by_path(file) + expected_label = generate_en_label_by_path(file) + return first_line == expected_label, first_line, expected_label # path -> api_label (the first line's style) @@ -74,12 +75,25 @@ def should_test(file): def run_cn_api_label_checking(rootdir, files): + pass_check = True for file in files: - if should_test(file) and not check_api_label(rootdir, file): - logger.error( - f"The first line in {rootdir}/{file} is not available, please re-check it!" - ) - sys.exit(1) + if should_test(file): + check, actual, expected = check_api_label(rootdir, file) + if not check: + logger.error( + f"❌ First Line API Label Mismatch\n" + f" File: {file}\n" + f" 🔥 Actual: `{actual}`\n" + f" ✅ Expected: `{expected}`\n\n" + f" (Note: The 'Expected' label is auto-generated based on the file path.\n" + f" Please check if the filename is correct or update the first line of the file to match.)" + ) + pass_check = False + if pass_check: + logger.info("All First Line API Label Check Passed !") + else: + logger.error("Some First Line API Label Check Failed !") + sys.exit(1) valid_api_labels = find_all_api_labels_in_dir(rootdir) for file in files: if not file.endswith(".rst"): diff --git a/docs/api/paddle/nn/CircularPad1D__upper_cn.rst b/docs/api/paddle/nn/CircularPad1D__upper_cn.rst new file mode 100644 index 00000000000..49be7dff35d --- /dev/null +++ b/docs/api/paddle/nn/CircularPad1D__upper_cn.rst @@ -0,0 +1,23 @@ +.. _cn_api_paddle_nn_CircularPad1D__upper: + +CircularPad1D +------------------------------- +.. py:class:: paddle.nn.CircularPad1D(padding, data_format="NCL", name=None) + +使用循环填充的方式来填充输入张量的边界。 + +参数 +:::::::::::: + + - **padding** (Tensor|Sequence[int]|int) - 填充大小。如果 `padding` 是一个整数,则在左、右两边都应用相同的填充。如果 `padding` 是一个包含两个整数的列表或元组,它将被解析为 `(pad_left, pad_right)`。 + - **data_format** (str,可选) - 指定输入的数据格式,可为 ``'NCL'`` 或 ``'NLC'``。默认值:``'NCL'``。 + - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 + +返回 +:::::::::::: +Tensor,填充后的张量。 + +代码示例 +:::::::::::: + +COPY-FROM: paddle.nn.CircularPad1D diff --git a/docs/api/paddle/nn/CircularPad1d_cn.rst b/docs/api/paddle/nn/CircularPad1d_cn.rst new file mode 100644 index 00000000000..ef604e9452b --- /dev/null +++ b/docs/api/paddle/nn/CircularPad1d_cn.rst @@ -0,0 +1,7 @@ +.. _cn_api_paddle_nn_CircularPad1d: + +CircularPad1d +------------------------------- +.. py:class:: paddle.nn.CircularPad1d(padding, data_format="NCL", name=None) + +``CircularPad1D`` 的别名,请参考 :ref:`cn_api_paddle_nn_CircularPad1D__upper`。 diff --git a/docs/api/paddle/nn/CircularPad2D__upper_cn.rst b/docs/api/paddle/nn/CircularPad2D__upper_cn.rst new file mode 100644 index 00000000000..883c2ab6561 --- /dev/null +++ b/docs/api/paddle/nn/CircularPad2D__upper_cn.rst @@ -0,0 +1,23 @@ +.. _cn_api_paddle_nn_CircularPad2D__upper: + +CircularPad2D +------------------------------- +.. py:class:: paddle.nn.CircularPad2D(padding, data_format="NCHW", name=None) + +使用循环填充的方式来填充输入张量的边界。 + +参数 +:::::::::::: + + - **padding** (Tensor|Sequence[int]|int) - 填充大小。如果 `padding` 是一个整数,则在左、右、上、下四个边界都应用相同的填充。如果 `padding` 是一个包含四个整数的列表或元组,它将被解析为 `(pad_left, pad_right, pad_top, pad_bottom)`。 + - **data_format** (str,可选) - 指定输入的数据格式,可为 ``'NCHW'`` 或 ``'NHWC'``。默认值:``'NCHW'``。 + - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 + +返回 +:::::::::::: +Tensor,填充后的张量。 + +代码示例 +:::::::::::: + +COPY-FROM: paddle.nn.CircularPad2D diff --git a/docs/api/paddle/nn/CircularPad2d_cn.rst b/docs/api/paddle/nn/CircularPad2d_cn.rst new file mode 100644 index 00000000000..4b31201e5cd --- /dev/null +++ b/docs/api/paddle/nn/CircularPad2d_cn.rst @@ -0,0 +1,7 @@ +.. _cn_api_paddle_nn_CircularPad2d: + +CircularPad2d +------------------------------- +.. py:class:: paddle.nn.CircularPad2d(padding, data_format="NCHW", name=None) + +``CircularPad2D`` 的别名,请参考 :ref:`cn_api_paddle_nn_CircularPad2D__upper`。 diff --git a/docs/api/paddle/nn/CircularPad3D__upper_cn.rst b/docs/api/paddle/nn/CircularPad3D__upper_cn.rst new file mode 100644 index 00000000000..a62c66fa6a5 --- /dev/null +++ b/docs/api/paddle/nn/CircularPad3D__upper_cn.rst @@ -0,0 +1,23 @@ +.. _cn_api_paddle_nn_CircularPad3D__upper: + +CircularPad3D +------------------------------- +.. py:class:: paddle.nn.CircularPad3D(padding, data_format="NCDHW", name=None) + +使用循环填充的方式来填充输入张量的边界。 + +参数 +:::::::::::: + + - **padding** (Tensor|Sequence[int]|int) - 填充大小。如果 `padding` 是一个整数,则在左、右、上、下、前、后六个边界都应用相同的填充。如果 `padding` 是一个包含六个整数的列表或元组,它将被解析为 `(pad_left, pad_right, pad_top, pad_bottom, pad_front, pad_back)`。 + - **data_format** (str,可选) - 指定输入的数据格式,可为 ``'NCDHW'`` 或 ``'NDHWC'``。默认值:``'NCDHW'``。 + - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 + +返回 +:::::::::::: +Tensor,填充后的张量。 + +代码示例 +:::::::::::: + +COPY-FROM: paddle.nn.CircularPad3D diff --git a/docs/api/paddle/nn/CircularPad3d_cn.rst b/docs/api/paddle/nn/CircularPad3d_cn.rst new file mode 100644 index 00000000000..941faca2b38 --- /dev/null +++ b/docs/api/paddle/nn/CircularPad3d_cn.rst @@ -0,0 +1,7 @@ +.. _cn_api_paddle_nn_CircularPad3d: + +CircularPad3d +------------------------------- +.. py:class:: paddle.nn.CircularPad3d(padding, data_format="NCDHW", name=None) + +``CircularPad3D`` 的别名,请参考 :ref:`cn_api_paddle_nn_CircularPad3D__upper`。 diff --git a/docs/api/paddle/nn/ConstantPad1D__upper_cn.rst b/docs/api/paddle/nn/ConstantPad1D__upper_cn.rst new file mode 100644 index 00000000000..57a8843455e --- /dev/null +++ b/docs/api/paddle/nn/ConstantPad1D__upper_cn.rst @@ -0,0 +1,24 @@ +.. _cn_api_paddle_nn_ConstantPad1D__upper: + +ConstantPad1D +------------------------------- +.. py:class:: paddle.nn.ConstantPad1D(padding, value, data_format="NCL", name=None) + +使用一个常量值来填充输入张量的边界。 + +参数 +:::::::::::: + + - **padding** (Tensor|Sequence[int]|int) - 填充大小。如果 `padding` 是一个整数,则在左、右两边都应用相同的填充。如果 `padding` 是一个包含两个整数的列表或元组,它将被解析为 `(pad_left, pad_right)`。 + - **value** (float) - 用于填充区域的常量值。 + - **data_format** (str,可选) - 指定输入的数据格式,可为 ``'NCL'`` 或 ``'NLC'``。默认值:``'NCL'``。 + - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 + +返回 +:::::::::::: +Tensor,填充后的张量。 + +代码示例 +:::::::::::: + +COPY-FROM: paddle.nn.ConstantPad1D diff --git a/docs/api/paddle/nn/ConstantPad1d_cn.rst b/docs/api/paddle/nn/ConstantPad1d_cn.rst new file mode 100644 index 00000000000..364533a29dd --- /dev/null +++ b/docs/api/paddle/nn/ConstantPad1d_cn.rst @@ -0,0 +1,7 @@ +.. _cn_api_paddle_nn_ConstantPad1d: + +ConstantPad1d +------------------------------- +.. py:class:: paddle.nn.ConstantPad1d(padding, value, data_format="NCL", name=None) + +``Constant1D`` 的别名,请参考 :ref:`cn_api_paddle_nn_Constant1D__upper`。 diff --git a/docs/api/paddle/nn/ConstantPad2D__upper_cn.rst b/docs/api/paddle/nn/ConstantPad2D__upper_cn.rst new file mode 100644 index 00000000000..26e8fa0ccd6 --- /dev/null +++ b/docs/api/paddle/nn/ConstantPad2D__upper_cn.rst @@ -0,0 +1,24 @@ +.. _cn_api_paddle_nn_ConstantPad2D__upper: + +ConstantPad2D +------------------------------- +.. py:class:: paddle.nn.ConstantPad2D(padding, value, data_format="NCHW", name=None) + +使用一个常量值来填充输入张量的边界。 + +参数 +:::::::::::: + + - **padding** (Tensor|Sequence[int]|int) - 填充大小。如果 `padding` 是一个整数,则在所有四个边(左、右、上、下)应用相同的填充。如果 `padding` 是一个包含四个整数的列表或元组,它将被解析为 `(pad_left, pad_right, pad_top, pad_bottom)`。 + - **value** (float) - 用于填充区域的常量值。 + - **data_format** (str,可选) - 指定输入的数据格式,可为 ``'NCHW'`` 或 ``'NHWC'``。默认值:``'NCHW'``。 + - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 + +返回 +:::::::::::: +Tensor,填充后的张量。 + +代码示例 +:::::::::::: + +COPY-FROM: paddle.nn.ConstantPad2D diff --git a/docs/api/paddle/nn/ConstantPad2d_cn.rst b/docs/api/paddle/nn/ConstantPad2d_cn.rst new file mode 100644 index 00000000000..dfd3a1b7122 --- /dev/null +++ b/docs/api/paddle/nn/ConstantPad2d_cn.rst @@ -0,0 +1,7 @@ +.. _cn_api_paddle_nn_ConstantPad2d: + +ConstantPad2d +------------------------------- +.. py:class:: paddle.nn.ConstantPad2d(padding, value, data_format="NCHW", name=None) + +``Constant2D`` 的别名,请参考 :ref:`cn_api_paddle_nn_Constant2D__upper`。 diff --git a/docs/api/paddle/nn/ConstantPad3D__upper_cn.rst b/docs/api/paddle/nn/ConstantPad3D__upper_cn.rst new file mode 100644 index 00000000000..e8980771c96 --- /dev/null +++ b/docs/api/paddle/nn/ConstantPad3D__upper_cn.rst @@ -0,0 +1,24 @@ +.. _cn_api_paddle_nn_ConstantPad3D__upper: + +ConstantPad3d +------------------------------- +.. py:class:: paddle.nn.ConstantPad3d(padding, value, data_format="NCDHW", name=None) + +使用一个常量值来填充输入张量的边界。 + +参数 +:::::::::::: + + - **padding** (Tensor|Sequence[int]|int) - 填充大小。如果 `padding` 是一个整数,则在所有六个边(左、右、上、下、前、后)应用相同的填充。如果 `padding` 是一个包含六个整数的列表或元组,它将被解析为 `(pad_left, pad_right, pad_top, pad_bottom, pad_front, pad_back)`。 + - **value** (float) - 用于填充区域的常量值。 + - **data_format** (str,可选) - 指定输入的数据格式,可为 ``'NCDHW'`` 或 ``'NDHWC'``。默认值:``'NCDHW'``。 + - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 + +返回 +:::::::::::: +Tensor,填充后的张量。 + +代码示例 +:::::::::::: + +COPY-FROM: paddle.nn.ConstantPad3D diff --git a/docs/api/paddle/nn/ConstantPad3d_cn.rst b/docs/api/paddle/nn/ConstantPad3d_cn.rst new file mode 100644 index 00000000000..43d7a6ee739 --- /dev/null +++ b/docs/api/paddle/nn/ConstantPad3d_cn.rst @@ -0,0 +1,7 @@ +.. _cn_api_paddle_nn_ConstantPad3d: + +ConstantPad3d +------------------------------- +.. py:class:: paddle.nn.ConstantPad3d(padding, value, data_format="NCDHW", name=None) + +``Constant3D`` 的别名,请参考 :ref:`cn_api_paddle_nn_Constant3D__upper`。 diff --git a/docs/api/paddle/nn/Overview_cn.rst b/docs/api/paddle/nn/Overview_cn.rst index e1644dffc61..671a58ddf96 100644 --- a/docs/api/paddle/nn/Overview_cn.rst +++ b/docs/api/paddle/nn/Overview_cn.rst @@ -114,6 +114,31 @@ Padding 层 " :ref:`paddle.nn.ZeroPad1D ` ", "一维零填充层" " :ref:`paddle.nn.ZeroPad2D ` ", "二维零填充层" " :ref:`paddle.nn.ZeroPad3D ` ", "三维零填充层" + " :ref:`paddle.nn.ConstantPad1D ` ", "一维常量填充层" + " :ref:`paddle.nn.ConstantPad1d ` ", "一维常量填充层(与前一 API 仅大小写不一致)" + " :ref:`paddle.nn.ConstantPad2D ` ", "二维常量填充层" + " :ref:`paddle.nn.ConstantPad2d ` ", "二维常量填充层(与前一 API 仅大小写不一致)" + " :ref:`paddle.nn.ConstantPad3D ` ", "三维常量填充层" + " :ref:`paddle.nn.ConstantPad3d ` ", "三维常量填充层(与前一 API 仅大小写不一致)" + " :ref:`paddle.nn.ReflectionPad1D ` ", "一维反射填充层" + " :ref:`paddle.nn.ReflectionPad1d ` ", "一维反射填充层(与前一 API 仅大小写不一致)" + " :ref:`paddle.nn.ReflectionPad2D ` ", "二维反射填充层" + " :ref:`paddle.nn.ReflectionPad2d ` ", "二维反射填充层(与前一 API 仅大小写不一致)" + " :ref:`paddle.nn.ReflectionPad3D ` ", "三维反射填充层" + " :ref:`paddle.nn.ReflectionPad3d ` ", "三维反射填充层(与前一 API 仅大小写不一致)" + " :ref:`paddle.nn.ReplicationPad1D ` ", "一维复制填充层" + " :ref:`paddle.nn.ReplicationPad1d ` ", "一维复制填充层(与前一 API 仅大小写不一致)" + " :ref:`paddle.nn.ReplicationPad2D ` ", "二维复制填充层" + " :ref:`paddle.nn.ReplicationPad2d ` ", "二维复制填充层(与前一 API 仅大小写不一致)" + " :ref:`paddle.nn.ReplicationPad3D ` ", "三维复制填充层" + " :ref:`paddle.nn.ReplicationPad3d ` ", "三维复制填充层(与前一 API 仅大小写不一致)" + " :ref:`paddle.nn.CircularPad1D ` ", "一维循环填充层" + " :ref:`paddle.nn.CircularPad1d ` ", "一维循环填充层(与前一 API 仅大小写不一致)" + " :ref:`paddle.nn.CircularPad2D ` ", "二维循环填充层" + " :ref:`paddle.nn.CircularPad2d ` ", "二维循环填充层(与前一 API 仅大小写不一致)" + " :ref:`paddle.nn.CircularPad3D ` ", "三维循环填充层" + " :ref:`paddle.nn.CircularPad3d ` ", "三维循环填充层(与前一 API 仅大小写不一致)" + .. _activation_layers: diff --git a/docs/api/paddle/nn/ReflectionPad1D__upper_cn.rst b/docs/api/paddle/nn/ReflectionPad1D__upper_cn.rst new file mode 100644 index 00000000000..20b88f94729 --- /dev/null +++ b/docs/api/paddle/nn/ReflectionPad1D__upper_cn.rst @@ -0,0 +1,23 @@ +.. _cn_api_paddle_nn_ReflectionPad1D__upper: + +ReflectionPad1D +------------------------------- +.. py:class:: paddle.nn.ReflectionPad1D(padding, data_format="NCL", name=None) + +使用输入边界的反射来填充输入张量的边界。 + +参数 +:::::::::::: + + - **padding** (Tensor|Sequence[int]|int) - 填充大小。如果 `padding` 是一个整数,则在左、右两边都应用相同的填充。如果 `padding` 是一个包含两个整数的列表或元组,它将被解析为 `(pad_left, pad_right)`。填充宽度必须小于相应输入的维度。 + - **data_format** (str,可选) - 指定输入的数据格式,可为 ``'NCL'`` 或 ``'NLC'``。默认值:``'NCL'``。 + - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 + +返回 +:::::::::::: +Tensor,填充后的张量。 + +代码示例 +:::::::::::: + +COPY-FROM: paddle.nn.ReflectionPad1D diff --git a/docs/api/paddle/nn/ReflectionPad1d_cn.rst b/docs/api/paddle/nn/ReflectionPad1d_cn.rst new file mode 100644 index 00000000000..8b45abf21c8 --- /dev/null +++ b/docs/api/paddle/nn/ReflectionPad1d_cn.rst @@ -0,0 +1,7 @@ +.. _cn_api_paddle_nn_ReflectionPad1d: + +ReflectionPad1D +------------------------------- +.. py:class:: paddle.nn.ReflectionPad1D(padding, data_format="NCL", name=None) + +``ReflectionPad1D`` 的别名,请参考 :ref:`cn_api_paddle_nn_ReflectionPad1D__upper`。 diff --git a/docs/api/paddle/nn/ReflectionPad2D__upper_cn.rst b/docs/api/paddle/nn/ReflectionPad2D__upper_cn.rst new file mode 100644 index 00000000000..870de3cc929 --- /dev/null +++ b/docs/api/paddle/nn/ReflectionPad2D__upper_cn.rst @@ -0,0 +1,23 @@ +.. _cn_api_paddle_nn_ReflectionPad2D__upper: + +ReflectionPad2D +------------------------------- +.. py:class:: paddle.nn.ReflectionPad2D(padding, data_format="NCHW", name=None) + +使用输入边界的反射来填充输入张量的边界。 + +参数 +:::::::::::: + + - **padding** (Tensor|Sequence[int]|int) - 填充大小。如果 `padding` 是一个整数,则在所有四个边(左、右、上、下)应用相同的填充。如果 `padding` 是一个包含四个整数的列表或元组,它将被解析为 `(pad_left, pad_right, pad_top, pad_bottom)`。填充宽度必须小于相应输入的维度。 + - **data_format** (str,可选) - 指定输入的数据格式,可为 ``'NCHW'`` 或 ``'NHWC'``。默认值:``'NCHW'``。 + - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 + +返回 +:::::::::::: +Tensor,填充后的张量。 + +代码示例 +:::::::::::: + +COPY-FROM: paddle.nn.ReflectionPad2D diff --git a/docs/api/paddle/nn/ReflectionPad2d_cn.rst b/docs/api/paddle/nn/ReflectionPad2d_cn.rst new file mode 100644 index 00000000000..ae3073cedec --- /dev/null +++ b/docs/api/paddle/nn/ReflectionPad2d_cn.rst @@ -0,0 +1,9 @@ +.. _cn_api_paddle_nn_ReflectionPad2d: + +ReflectionPad2d +------------------------------- +.. py:class:: paddle.nn.ReflectionPad2d(padding, data_format="NCHW", name=None) + +使用输入边界的反射来填充输入张量的边界。 + +``ReflectionPad2D`` 的别名,请参考 :ref:`cn_api_paddle_nn_ReflectionPad2D__upper`。 diff --git a/docs/api/paddle/nn/ReflectionPad3D__upper_cn.rst b/docs/api/paddle/nn/ReflectionPad3D__upper_cn.rst new file mode 100644 index 00000000000..a6c44534dff --- /dev/null +++ b/docs/api/paddle/nn/ReflectionPad3D__upper_cn.rst @@ -0,0 +1,23 @@ +.. _cn_api_paddle_nn_ReflectionPad3D__upper: + +ReflectionPad3D +------------------------------- +.. py:class:: paddle.nn.ReflectionPad3D(padding, data_format="NCDHW", name=None) + +使用输入边界的反射来填充输入张量的边界。 + +参数 +:::::::::::: + + - **padding** (Tensor|Sequence[int]|int) - 填充大小。如果 `padding` 是一个整数,则在所有六个边(左、右、上、下、前、后)应用相同的填充。如果 `padding` 是一个包含六个整数的列表或元组,它将被解析为 `(pad_left, pad_right, pad_top, pad_bottom, pad_front, pad_back)`。填充宽度必须小于相应输入的维度。 + - **data_format** (str,可选) - 指定输入的数据格式,可为 ``'NCDHW'`` 或 ``'NDHWC'``。默认值:``'NCDHW'``。 + - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 + +返回 +:::::::::::: +Tensor,填充后的张量。 + +代码示例 +:::::::::::: + +COPY-FROM: paddle.nn.ReflectionPad3D diff --git a/docs/api/paddle/nn/ReflectionPad3d_cn.rst b/docs/api/paddle/nn/ReflectionPad3d_cn.rst new file mode 100644 index 00000000000..443116ea3d8 --- /dev/null +++ b/docs/api/paddle/nn/ReflectionPad3d_cn.rst @@ -0,0 +1,7 @@ +.. _cn_api_paddle_nn_ReflectionPad3d: + +ReflectionPad3d +------------------------------- +.. py:class:: paddle.nn.ReflectionPad3d(padding, data_format="NCDHW", name=None) + +``ReflectionPad3D`` 的别名,请参考 :ref:`cn_api_paddle_nn_ReflectionPad3D__upper`。 diff --git a/docs/api/paddle/nn/ReplicationPad1D__upper_cn.rst b/docs/api/paddle/nn/ReplicationPad1D__upper_cn.rst new file mode 100644 index 00000000000..e5c7fb0ae94 --- /dev/null +++ b/docs/api/paddle/nn/ReplicationPad1D__upper_cn.rst @@ -0,0 +1,23 @@ +.. _cn_api_paddle_nn_ReplicationPad1D__upper: + +ReplicationPad1D +------------------------------- +.. py:class:: paddle.nn.ReplicationPad1D(padding, data_format="NCL", name=None) + +通过复制边缘值来填充输入张量的边界。 + +参数 +:::::::::::: + + - **padding** (Tensor|Sequence[int]|int) - 填充大小。如果 `padding` 是一个整数,则在左、右两边都应用相同的填充。如果 `padding` 是一个包含两个整数的列表或元组,它将被解析为 `(pad_left, pad_right)`。 + - **data_format** (str,可选) - 指定输入的数据格式,可为 ``'NCL'`` 或 ``'NLC'``。默认值:``'NCL'``。 + - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 + +返回 +:::::::::::: +Tensor,填充后的张量。 + +代码示例 +:::::::::::: + +COPY-FROM: paddle.nn.ReplicationPad1D diff --git a/docs/api/paddle/nn/ReplicationPad1d_cn.rst b/docs/api/paddle/nn/ReplicationPad1d_cn.rst new file mode 100644 index 00000000000..12df46e19fc --- /dev/null +++ b/docs/api/paddle/nn/ReplicationPad1d_cn.rst @@ -0,0 +1,7 @@ +.. _cn_api_paddle_nn_ReplicationPad1d: + +ReplicationPad1d +------------------------------- +.. py:class:: paddle.nn.ReplicationPad1d(padding, data_format="NCL", name=None) + +``ReflectionPad1D`` 的别名,请参考 :ref:`cn_api_paddle_nn_ReflectionPad1D__upper`。 diff --git a/docs/api/paddle/nn/ReplicationPad2D__upper_cn.rst b/docs/api/paddle/nn/ReplicationPad2D__upper_cn.rst new file mode 100644 index 00000000000..d9175134b8c --- /dev/null +++ b/docs/api/paddle/nn/ReplicationPad2D__upper_cn.rst @@ -0,0 +1,23 @@ +.. _cn_api_paddle_nn_ReplicationPad2D__upper: + +ReplicationPad2D +------------------------------- +.. py:class:: paddle.nn.ReplicationPad2D(padding, data_format="NCHW", name=None) + +通过复制边缘值来填充输入张量的边界。 + +参数 +:::::::::::: + + - **padding** (Tensor|Sequence[int]|int) - 填充大小。如果 `padding` 是一个整数,则在所有四个边(左、右、上、下)应用相同的填充。如果 `padding` 是一个包含四个整数的列表或元组,它将被解析为 `(pad_left, pad_right, pad_top, pad_bottom)`。 + - **data_format** (str,可选) - 指定输入的数据格式,可为 ``'NCHW'`` 或 ``'NHWC'``。默认值:``'NCHW'``。 + - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 + +返回 +:::::::::::: +Tensor,填充后的张量。 + +代码示例 +:::::::::::: + +COPY-FROM: paddle.nn.ReplicationPad2D diff --git a/docs/api/paddle/nn/ReplicationPad2d_cn.rst b/docs/api/paddle/nn/ReplicationPad2d_cn.rst new file mode 100644 index 00000000000..4c95fdc7535 --- /dev/null +++ b/docs/api/paddle/nn/ReplicationPad2d_cn.rst @@ -0,0 +1,7 @@ +.. _cn_api_paddle_nn_ReplicationPad2d: + +ReplicationPad2d +------------------------------- +.. py:class:: paddle.nn.ReplicationPad2d(padding, data_format="NCHW", name=None) + +```ReplicationPad1d`` 的别名,请参考 :ref:`cn_api_paddle_nn_ReplicationPad1d`。 diff --git a/docs/api/paddle/nn/ReplicationPad3D__upper_cn.rst b/docs/api/paddle/nn/ReplicationPad3D__upper_cn.rst new file mode 100644 index 00000000000..411d8a84ff4 --- /dev/null +++ b/docs/api/paddle/nn/ReplicationPad3D__upper_cn.rst @@ -0,0 +1,23 @@ +.. _cn_api_paddle_nn_ReplicationPad3D__upper: + +ReplicationPad3D +------------------------------- +.. py:class:: paddle.nn.ReplicationPad3D(padding, data_format="NCDHW", name=None) + +通过复制边缘值来填充输入张量的边界。 + +参数 +:::::::::::: + + - **padding** (Tensor|Sequence[int]|int) - To. 填充大小。如果 `padding` 是一个整数,则在所有六个边(左、右、上、下、前、后)应用相同的填充。如果 `padding` 是一个包含六个整数的列表或元组,它将被解析为 `(pad_left, pad_right, pad_top, pad_bottom, pad_front, pad_back)`。 + - **data_format** (str,可选) - 指定输入的数据格式,可为 ``'NCDHW'`` 或 ``'NDHWC'``。默认值:``'NCDHW'``。 + - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 + +返回 +:::::::::::: +Tensor,填充后的张量。 + +代码示例 +:::::::::::: + +COPY-FROM: paddle.nn.ReplicationPad3D diff --git a/docs/api/paddle/nn/ReplicationPad3d_cn.rst b/docs/api/paddle/nn/ReplicationPad3d_cn.rst new file mode 100644 index 00000000000..5e771458df1 --- /dev/null +++ b/docs/api/paddle/nn/ReplicationPad3d_cn.rst @@ -0,0 +1,7 @@ +.. _cn_api_paddle_nn_ReplicationPad3d: + +ReplicationPad3d +------------------------------- +.. py:class:: paddle.nn.ReplicationPad3d(padding, data_format="NCDHW", name=None) + +```ReplicationPad3D`` 的别名,请参考 :ref:`cn_api_paddle_nn_ReplicationPad3D__upper`。