Skip to content

Commit

Permalink
【Hackathon 5th No.13】Added signbit doc (PaddlePaddle#6340)
Browse files Browse the repository at this point in the history
* Docs: updated signbit doc.

* Docs: updated signbit doc.

* Docs: updated signbit doc.

* updated signbit doc
  • Loading branch information
PommesPeter authored Dec 19, 2023
1 parent 532b063 commit 2979eb8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/api/paddle/Overview_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ tensor 数学操作
" :ref:`paddle.rsqrt <cn_api_paddle_rsqrt>` ", "rsqrt 激活函数"
" :ref:`paddle.scale <cn_api_paddle_scale>` ", "缩放算子"
" :ref:`paddle.sign <cn_api_paddle_sign>` ", "对输入 x 中每个元素进行正负判断"
" :ref:`paddle.signbit <cn_api_paddle_signbit>` ", "对输入 x 的每个元素符号位进行判断"
" :ref:`paddle.sgn <cn_api_paddle_sgn>` ", "对输入 x 中每个元素进行正负判断,对于复数则输出单位向量"
" :ref:`paddle.sin <cn_api_paddle_sin>` ", "计算输入的正弦值"
" :ref:`paddle.sinh <cn_api_paddle_sinh>` ", "双曲正弦函数"
Expand Down
11 changes: 11 additions & 0 deletions docs/api/paddle/Tensor_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3164,3 +3164,14 @@ select_scatter(x, values, axis, index, name=None)
返回类型:Tensor

请参考 :ref:`cn_api_paddle_select_scatter`

signbit(x, name=None)
:::::::::

返回 x 的判断值掩码 Tensor,若存在符号位,则输出 True,否则输出 False。

返回:判断值掩码 Tensor。

返回类型:Tensor

请参考 :ref:`cn_api_paddle_signbit`
23 changes: 23 additions & 0 deletions docs/api/paddle/signbit_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. _cn_api_paddle_signbit:

signbit
-------------------------------

.. py:function:: paddle.signbit(x, name=None)
对输入参数 ``x`` 的每个元素判断是否设置了其符号位,并输出判断值。若存在符号位,则输出 True,否则输出 False。

参数
::::::::::::
- **x** (Tensor) – 进行符号位判断的多维 Tensor,数据类型为 int8,int16,int32,int64,float16,float32 或 float64。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

返回
::::::::::::
Tensor,输出掩码,数据的 shape 大小及数据类型和输入 ``x`` 一致。


代码示例
::::::::::::

COPY-FROM: paddle.signbit

0 comments on commit 2979eb8

Please sign in to comment.