Skip to content

Commit

Permalink
【Hackathon4】No6. Add chinese doc files for ldexp (#5925)
Browse files Browse the repository at this point in the history
* add cn docs for ldexp

* Update docs/api/paddle/ldexp_cn.rst

Co-authored-by: zachary sun <[email protected]>

* Update docs/api/paddle/Overview_cn.rst

Co-authored-by: zachary sun <[email protected]>

* fix codestyle

---------

Co-authored-by: zachary sun <[email protected]>
  • Loading branch information
longranger2 and sunzhongkai588 authored Jun 12, 2023
1 parent 0132db1 commit 188c453
Show file tree
Hide file tree
Showing 2 changed files with 28 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 @@ -100,6 +100,7 @@ tensor 数学操作
" :ref:`paddle.outer <cn_api_tensor_outer>` ", "计算两个输入矩阵的外积"
" :ref:`paddle.multiplex <cn_api_fluid_layers_multiplex>` ", "从每个输入 Tensor 中选择特定行构造输出 Tensor"
" :ref:`paddle.multiply <cn_api_fluid_layers_multiply>` ", "逐元素相乘算子"
" :ref:`paddle.ldexp <cn_api_layers_ldexp>` ", "计算 x 乘以 2 的 y 次幂"
" :ref:`paddle.nan_to_num <cn_api_tensor_nan_to_num>` ", "替换 x 中的 NaN、+inf、-inf 为指定值"
" :ref:`paddle.neg <cn_api_paddle_neg>` ", "计算输入 x 的相反数并返回"
" :ref:`paddle.nextafter <cn_api_paddle_nextafter>` ", "逐元素将 x 之后的下一个浮点值返回"
Expand Down
27 changes: 27 additions & 0 deletions docs/api/paddle/ldexp_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. _cn_api_layers_ldexp:

ldexp
-------------------------------

.. py:function:: paddle.ldexp(x, y, name=None)
计算 `x` 乘以 2 的 `y` 次幂

.. math::
out = x * 2^{y}
参数
::::::::::::

- **x** (Tensor) - 多维 Tensor。数据类型为 float32、float64、int32、int64。
- **y** (Tensor) - 多维 Tensor。通常为整数。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

返回
::::::::::::
输出为 Tensor,如果 ``x``, ``y`` 有不同的形状并且是可广播的,那么产生的张量形状是广播后 x 和 y 的形状。如果 ``x``, ``y`` 有相同的形状,其形状与 ``x``, ``y`` 相同。数据类型是 float32 或 float64。

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

COPY-FROM: paddle.ldexp

0 comments on commit 188c453

Please sign in to comment.