Skip to content

【Hackathon 5th No.9】为 Paddle 新增 multigammaln API #6319

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

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions docs/api/paddle/Overview_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ tensor 数学操作
" :ref:`paddle.multiplex <cn_api_paddle_multiplex>` ", "从每个输入 Tensor 中选择特定行构造输出 Tensor"
" :ref:`paddle.multiply <cn_api_paddle_multiply>` ", "逐元素相乘算子"
" :ref:`paddle.ldexp <cn_api_paddle_ldexp>` ", "计算 x 乘以 2 的 y 次幂"
" :ref:`paddle.multigammaln <cn_api_paddle_multigammaln>` ", "计算多元伽马函数的对数"
" :ref:`paddle.nan_to_num <cn_api_paddle_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 Expand Up @@ -183,6 +184,7 @@ tensor 数学操作原位(inplace)版本
" :ref:`paddle.uniform_ <cn_api_paddle_uniform_>` ", "Inplace 版本的 uniform API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.lerp_ <cn_api_paddle_lerp_>` ", "Inplace 版本的 lerp API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.hypot_ <cn_api_paddle_hypot_>` ", "Inplace 版本的 hypot API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.multigammaln_ <cn_api_paddle_multigammaln_>` ", "Inplace 版本的 multigammaln API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.masked_fill_ <cn_api_paddle_masked_fill_>` ", "Inplace 版本的 masked_fill API,对输入 x 采用 Inplace 策略"
" :ref:`paddle.index_fill_ <cn_api_paddle_index_fill_>` ", "Inplace 版本的 index_fill API,对输入 x 采用 Inplace 策略"

Expand Down
12 changes: 12 additions & 0 deletions docs/api/paddle/multigammaln__cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _cn_api_paddle_multigammaln_:

multigammaln\_
-------------------------------

.. py:function:: paddle.multigammaln_(x, p, name=None)

Inplace 版本的 :ref:`cn_api_paddle_multigammaln` API,对输入 `x` 采用 Inplace 策略。

更多关于 inplace 操作的介绍请参考 `3.1.3 原位(Inplace)操作和非原位操作的区别`_ 了解详情。

.. _3.1.3 原位(Inplace)操作和非原位操作的区别: https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/beginner/tensor_cn.html#id3
24 changes: 24 additions & 0 deletions docs/api/paddle/multigammaln_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.. _cn_api_paddle_multigammaln:

multigammaln
-------------------------------

.. py:function:: multigammaln(x, p, name=None)

计算多元伽马函数的对数。

参数
::::::::::::

- **x** - 输入 Tensor。数据类型必须为 float16, float32, float64, uint16。
- **p** - 多元伽马函数积分空间的维度。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

返回
::::::::::::
输出为 Tensor,与 ``x`` 维度相同、数据类型相同。

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

COPY-FROM: paddle.multigammaln