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

add fft2 function to paddle frontend! #19455

Closed
wants to merge 0 commits into from

Conversation

ArsalanAli915
Copy link
Contributor

Closed #19052

@ivy-leaves ivy-leaves added the Paddle Frontend Developing the Paddle Frontend, checklist triggered by commenting add_frontend_checklist label Jul 15, 2023
@ArsalanAli915
Copy link
Contributor Author

@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):
Copy link
Contributor

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)
Copy link
Contributor

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,
Copy link
Contributor

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(
Copy link
Contributor

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
Copy link
Contributor

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.

@ivy-leaves
Copy link

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 🤗

@ivy-seed
Copy link

ivy-seed commented Aug 4, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Paddle Frontend Developing the Paddle Frontend, checklist triggered by commenting add_frontend_checklist Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fft2
4 participants