-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
add fft2 function to paddle frontend! #19455
Conversation
@sagewhocodes please look at my pr and let me know what can change. |
"paddle", | ||
) | ||
@to_ivy_arrays_and_back | ||
def fft2(x, n=None, axes=(- 2, - 1), norm='backward', name=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per the paddle's implementation the argument should be s
and not n
.
) | ||
@to_ivy_arrays_and_back | ||
def fft2(x, n=None, axes=(- 2, - 1), norm='backward', name=None): | ||
ret = ivy.fft2(ivy.astype(x, "complex128"), axes, norm=norm, n=n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the functional API for fft2
has dim
as keyword only argument.
available_dtypes=helpers.get_dtypes("valid"), | ||
min_value=-10, | ||
max_value=10, | ||
min_num_dims=1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since fft2
is meant for 2D data specify min_num_dims
as 2 in the test
valid_axis=True, | ||
force_int_axis=True, | ||
), | ||
n=st.one_of( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change n
to s
, also seems to be incorrectly specified as per the paddle's docs here
test_flags, | ||
fn_tree, | ||
): | ||
input_dtypes, x, axes = dtype_x_axis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
axes
is incorrectly specified in the tests, axes should be in range of [-num_dims, num_dims
. For a tensor of shape (3,3,3) , num_dims
is 3
. hence the range of axes is [-3,3]
. Also make sure to have the correct type for this argument. See here for the types and more.
If you are working on an open task, please edit the PR description to link to the issue you've created. For more information, please check ToDo List Issues Guide. Thank you 🤗 |
This PR has been labelled as stale because it has been inactive for more than 7 days. If you would like to continue working on this PR, then please add another comment or this PR will be closed in 7 days. |
Closed #19052