Skip to main content

mlx_rs/fft/
options.rs

1use crate::Axes;
2
3/// Options shared by the n-dimensional FFT and real FFT transforms.
4///
5/// `lengths` and `axes` are correlated: when lengths are provided, there must be exactly one
6/// length per selected axis. An all-axis transform may provide one length per input dimension.
7/// A partial transform must set both fields, for example:
8///
9/// ```
10/// # use mlx_rs::{fft::FftnOptions, Axes};
11/// let options = FftnOptions {
12///     lengths: Some(vec![8, 16]),
13///     axes: Axes::from([-2, -1]),
14/// };
15/// # let _ = options;
16/// ```
17///
18/// Axis-only selection may use `FftnOptions { axes: (-1).into(), ..Default::default() }`.
19#[derive(Debug, Clone, Default, PartialEq, Eq)]
20pub struct FftnOptions {
21    /// Sizes of the transformed axes, or the input sizes when omitted.
22    pub lengths: Option<Vec<i32>>,
23
24    /// Axes to transform.
25    pub axes: Axes,
26}