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

[Hackathon No.28] add logcumsumexp docs #4807

Merged
merged 4 commits into from Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/api/paddle/Overview_cn.rst
Expand Up @@ -71,6 +71,7 @@ tensor数学操作
" :ref:`paddle.log <cn_api_fluid_layers_log>` ", "Log激活函数(计算自然对数)"
" :ref:`paddle.log10 <cn_api_paddle_tensor_math_log10>` ", "Log10激活函数(计算底为10的对数)"
" :ref:`paddle.log2 <cn_api_paddle_tensor_math_log2>` ", "计算Log1p(加一的自然对数)结果"
" :ref:`paddle.logcumsumexp <cn_api_paddle_tensor_math_logsumexp>` ", "计算 x 的指数的前缀和的对数"
" :ref:`paddle.logical_and <cn_api_fluid_layers_logical_and>` ", "逐元素的对 x 和 y 进行逻辑与运算"
" :ref:`paddle.logical_not <cn_api_fluid_layers_logical_not>` ", "逐元素的对 X Tensor进行逻辑非运算"
" :ref:`paddle.logical_or <cn_api_fluid_layers_logical_or>` ", "逐元素的对 X 和 Y 进行逻辑或运算"
Expand Down
1 change: 1 addition & 0 deletions docs/api/paddle/Tensor/Overview_en.rst
Expand Up @@ -162,6 +162,7 @@ Methods
log10
log1p
log2
logcumsumexp
logical_and
logical_not
logical_or
Expand Down
9 changes: 9 additions & 0 deletions docs/api/paddle/Tensor_cn.rst
Expand Up @@ -1343,6 +1343,15 @@ log1p(name=None)

请参考 :ref:`cn_api_paddle_tensor_log1p`

logcumsumexp(x, axis=None, dtype=None, name=None)
:::::::::

返回:计算后的Tensor

返回类型:Tensor

请参考 :ref:`cn_api_paddle_tensor_logcumsumexp`

logical_and(y, out=None, name=None)
:::::::::

Expand Down
27 changes: 27 additions & 0 deletions docs/api/paddle/logcumsumexp_cn.rst
@@ -0,0 +1,27 @@
.. _cn_api_tensor_logcumsumexp:

logcumsumexp
-------------------------------

.. py:function:: paddle.logcumsumexp(x, axis=None, dtype=None, name=None)

计算 x 的指数的前缀和的对数

**注意**:结果的第一个元素和输入的第一个元素相同。
Copy link
Collaborator

@Ligoml Ligoml May 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Note有专属样式,建议修改为 .. note::,可参考中文API文档模板
  • 句尾加句号
  • . -->
  • () --> ()
  • 参数需要加粗

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

均已更新。

很多已有的文档没有按照这个规范来写,会误导新人,建议统一改掉。

这个规范模板本身是不是也有问题,参数 x 的缩进不太对。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,最近在进行全量API文档的规范纠正,感谢指出,我们会尽快统一API文档的格式规范


参数
:::::::::
- x (Tensor) - 需要进行操作的Tensor.
- axis (int,可选) - 指明需要计算的维度。-1代表最后一维。默认:None,将输入展开为一维变量再进行计算。
- dtype (str,可选) - 输出Tensor的数据类型,支持float32、float64. 如果指定了,那么在执行操作之前,输入张量将被转换为dtype. 这对于防止数据类型溢出非常有用。默认为:None.
- name (str,可选)- 操作的名称(可选,默认值为None)。更多信息请参见 :ref:`api_guide_Name` 。

返回
:::::::::
- Tensor (Tensor),x 的指数的前缀和的对数。


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

COPY-FROM: paddle.logcumsumexp