Skip to content

Commit

Permalink
add frexp (PaddlePaddle#5276)
Browse files Browse the repository at this point in the history
* add frexp

* 修改

* 按照Paddle英文注释修改

* test

* 补充name

* 按照要求修改

* pre-commit

* pre-commit
  • Loading branch information
Zheng-Bicheng authored Sep 29, 2022
1 parent 0d9eef0 commit 4d2f8e1
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/api/api_label
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ paddle.Tensor.subtract_ .. _api_paddle_Tensor_subtract_:
paddle.sum .. _api_paddle_sum:
paddle.t .. _api_paddle_t:
paddle.take .. _api_paddle_take:
paddle.frexp .. _api_paddle_frexp:
paddle.tanh .. _api_paddle_tanh:
paddle.tanh_ .. _api_paddle_tanh_:
paddle.tile .. _api_paddle_tile:
Expand Down
1 change: 1 addition & 0 deletions docs/api/paddle/Overview_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ tensor 数学操作
" :ref:`paddle.asinh <cn_api_fluid_layers_asinh>` ", "反双曲正弦函数"
" :ref:`paddle.atanh <cn_api_fluid_layers_atanh>` ", "反双曲正切函数"
" :ref:`paddle.take <cn_api_tensor_take>` ", "输出给定索引处的输入元素,结果与 index 的形状相同"
" :ref:`paddle.frexp <cn_api_paddle_frexp>` ", "用于把一个浮点数分解为尾数和指数的函数"


.. _tensor_logic:
Expand Down
1 change: 1 addition & 0 deletions docs/api/paddle/Tensor/Overview_en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,4 @@ Methods
zero_
is_complex
is_integer
frexp
9 changes: 9 additions & 0 deletions docs/api/paddle/Tensor_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2457,3 +2457,12 @@ take(index, mode='raise', name=None)
返回类型:Tensor

请参考 :ref:`cn_api_tensor_take`

frexp(x)
:::::::::
用于把一个浮点数分解为尾数和指数的函数
返回:一个尾数 Tensor 和一个指数 Tensor

返回类型:Tensor, Tensor

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

frexp
-------------------------------

.. py:function:: paddle.frexp(x, name)
用于把一个浮点数分解为尾数和指数的函数, 返回一个尾数 Tensor 和一个指数 Tensor

参数
::::::::::
- **x** (Tensor) – 输入是一个多维的 Tensor,它的数据类型可以是 float32,float64。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name` ,一般无需设置,默认值为 None。
返回
::::::::::
mantissa(Tensor):分解后的尾数,类型为 Tensor,形状和原输入的形状一致。

exponent(Tensor):分解后的指数,类型为 Tensor,形状和原输入的形状一致。


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

COPY-FROM: paddle.frexp

0 comments on commit 4d2f8e1

Please sign in to comment.