-
Notifications
You must be signed in to change notification settings - Fork 766
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
【Hackathon 6th No. 7】Add sinc / sinc_ API to Paddle (#6634)
* add sinc docs * Update docs/api/paddle/sinc_cn.rst --------- Co-authored-by: zachary sun <70642955+sunzhongkai588@users.noreply.github.com>
- Loading branch information
1 parent
7f3d854
commit d715da6
Showing
4 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,6 +232,8 @@ Methods | |
sign | ||
sgn | ||
sin | ||
sinc | ||
sinc_ | ||
sinh | ||
slice | ||
solve | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.. _cn_api_paddle_sinc_: | ||
|
||
sinc\_ | ||
------------------------------- | ||
|
||
.. py:function:: paddle.sinc_(x, name=None) | ||
Inplace 版本的 :ref:`cn_api_paddle_sinc` 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
.. _cn_api_paddle_sinc: | ||
|
||
sinc | ||
------------------------------- | ||
|
||
.. py:function:: paddle.sinc(x, name=None) | ||
计算输入的归一化 sinc 值。 | ||
|
||
计算公式为: | ||
|
||
.. math:: | ||
out_i = | ||
\left\{ | ||
\begin{aligned} | ||
&1 & \text{ if $x_i = 0$} \\ | ||
&\frac{\sin(\pi x_i)}{\pi x_i} & \text{ otherwise} | ||
\end{aligned} | ||
\right. | ||
参数 | ||
:::::::::::: | ||
|
||
- **x** (Tensor) - 输入 Tensor。数据类型为 bfloat16,float16,float32,float64。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
:::::::::::: | ||
返回类型为 Tensor,数据类型同输入一致。 | ||
|
||
代码示例 | ||
:::::::::::: | ||
|
||
COPY-FROM: paddle.sinc |