From 501fd8f88997f5ae83cbc0187125c2f0ca975d91 Mon Sep 17 00:00:00 2001 From: PolaKuma <1356732652@qq.com> Date: Mon, 4 Nov 2024 13:41:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9masked=5Ffill=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E6=8F=8F=E8=BF=B0=E5=B9=B6=E5=A2=9E=E5=8A=A0=E5=9B=BE?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/api/paddle/masked_fill_cn.rst | 5 +++++ docs/images/api_legend/masked_fill.png | Bin 0 -> 28445 bytes 2 files changed, 5 insertions(+) create mode 100644 docs/images/api_legend/masked_fill.png diff --git a/docs/api/paddle/masked_fill_cn.rst b/docs/api/paddle/masked_fill_cn.rst index 93dfabcd2da..7e09708bb6a 100644 --- a/docs/api/paddle/masked_fill_cn.rst +++ b/docs/api/paddle/masked_fill_cn.rst @@ -21,6 +21,11 @@ masked_fill :::::::::::: 返回一个根据 ``mask`` 将对应位置填充为 ``value`` 的 Tensor,数据类型与 ``x`` 相同。 +下图展示了一个例子,假设我们有一个所有元素值为 1 的 3x3 矩阵 x 和一个相同尺寸的掩码矩阵 Mask , Value值为3。 + +.. image:: ../../images/api_legend/masked_fill.png + :width: 500 + :alt: 图例 代码示例 :::::::::::: diff --git a/docs/images/api_legend/masked_fill.png b/docs/images/api_legend/masked_fill.png new file mode 100644 index 0000000000000000000000000000000000000000..35634dd7dfb09194738b3c131fd9386f7f21ba29 GIT binary patch literal 28445 zcmeFZWmr`0+b;}=QUVGxfJi8yGzikEG)PIe(n!ZJG@>HXEr=qeba#WKN=r!$2t&uv zUGFs*fA8Dp*?WI@KkWB-A3elj)>>Db*V(`GTmj08()hSnanaDw@MUEr9-yINK0-r7 z7sI{)zPYCL2=yPP`CWy(XlR9Dct?-UgWqY4WgaM?p}F5gLwoWZ4ebDY^<*9m4a$L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QjT8G-N{uCYq#WB;xB|GSnJ$iX@`cq8-4^mC=r|9+2y8d(@( I_3uCXKceFq)&Kwi literal 0 HcmV?d00001 From 11411f97bcd3370d4d65984e1be25becb7ec6914 Mon Sep 17 00:00:00 2001 From: PolaKuma <1356732652@qq.com> Date: Tue, 5 Nov 2024 11:56:18 +0800 Subject: [PATCH 2/2] Update masked_fill_cn.rst --- docs/api/paddle/masked_fill_cn.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/api/paddle/masked_fill_cn.rst b/docs/api/paddle/masked_fill_cn.rst index 7e09708bb6a..36c7675fa4c 100644 --- a/docs/api/paddle/masked_fill_cn.rst +++ b/docs/api/paddle/masked_fill_cn.rst @@ -9,6 +9,12 @@ masked_fill 返回一个 1-D 的 Tensor,Tensor 的值是根据 ``mask`` 信息,将 ``value`` 中的值填充到 ``x`` 中 ``mask`` 对应为 ``True`` 的位置,``mask`` 的数据类型是 bool。 +下图展示了一个例子:假设我们有一个所有元素值为 1 的 3x3 矩阵 `x` 和一个相同尺寸的掩码矩阵 `Mask`,`Value` 值为 3。 + +.. image:: ../../images/api_legend/masked_fill.png + :width: 700 + :alt: 图例 + 参数 :::::::::::: @@ -21,12 +27,6 @@ masked_fill :::::::::::: 返回一个根据 ``mask`` 将对应位置填充为 ``value`` 的 Tensor,数据类型与 ``x`` 相同。 -下图展示了一个例子,假设我们有一个所有元素值为 1 的 3x3 矩阵 x 和一个相同尺寸的掩码矩阵 Mask , Value值为3。 - -.. image:: ../../images/api_legend/masked_fill.png - :width: 500 - :alt: 图例 - 代码示例 ::::::::::::