Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Hackathon4】No6. Add chinese doc files for ldexp #5925

Merged
merged 4 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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