Skip to content

Specify output shapes for fft functions #718

Closed
@asmeurer

Description

@asmeurer
Member

The fft functions do not specify what the output axis size should be. This is not necessarily always the same as the input axis size (or n).

For example, NumPy's ihfft uses an output shape of n//2 + 1 (https://numpy.org/doc/stable/reference/generated/numpy.fft.ihfft.html). This size is not mentioned anywhere in the spec.

Activity

leofang

leofang commented on Dec 6, 2023

@leofang
Contributor

Yes, I think it'd be nice to mention this for rfft, rfftn, and ihfft. Usually, the n or s input argument defines the length of the output along the transformed axis (and other axes have the same lengths), but for the 3 APIs doing R2C transform, n/s is for the input not output.

added this to the v2023 milestone on Dec 6, 2023
added a commit that references this issue on Dec 12, 2023
1dd9757
added a commit that references this issue on Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: FFTFast Fourier transforms.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @asmeurer@rgommers@kgryte@leofang

      Issue actions

        Specify output shapes for fft functions · Issue #718 · data-apis/array-api