Skip to content

Commit

Permalink
Merge pull request #1 from iclementine/niuzhibo-develop_fft
Browse files Browse the repository at this point in the history
Add sample code for ihfft2
  • Loading branch information
zhiboniu authored Oct 8, 2021
2 parents dd84743 + 85bc93a commit f3c024a
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion python/paddle/tensor/fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,24 @@ def ihfft2(x, s=None, axes=(-2, -1), norm="backward", name=None):
refer to :ref:`api_guide_Name` .
Returns:
out(Tensor) : The result of the inverse real 2-D FFT.
out(Tensor) : The result of the inverse hermitian 2-D FFT.
Examples:
.. code-block:: python
import numpy as np
import paddle
x = np.mgrid[:5, :5][0].astype(np.float64)
xp = paddle.to_tensor(x)
ihfft2_xp = paddle.fft.ihfft2(xp).numpy()
print(ihfft2_xp)
# [[ 2. +0.j 0. +0.j 0. +0.j ]
# [-0.5-0.68819096j 0. +0.j 0. +0.j ]
# [-0.5-0.16245985j 0. +0.j 0. +0.j ]
# [-0.5+0.16245985j 0. +0.j 0. +0.j ]
# [-0.5+0.68819096j 0. +0.j 0. +0.j ]]
"""
_check_at_least_ndim(x, 2)
if s is not None:
Expand Down

1 comment on commit f3c024a

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

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

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.