FFTOptions#
- 
class nvmath.fft. FFTOptions( 
- fft_type: Literal['C2C', 'C2R', 'R2C'] | None = None,
- inplace: bool = False,
- last_axis_parity: Literal['even', 'odd'] = 'even',
- result_layout: Literal['natural', 'optimized'] = 'optimized',
- device_id: int | None = None,
- logger: Logger | None = None,
- blocking: Literal[True, 'auto'] = 'auto',
- allocator: BaseCUDAMemoryManager | None = None,
- A data class for providing options to the - FFTobject and the family of wrapper functions- fft(),- ifft(),- rfft(), and- irfft().- fft_type#
- The type of FFT to perform, available options include - 'C2C',- 'C2R', and- 'R2C'. The default is- 'C2C'for complex input and- 'R2C'for real input.- Type:
- Literal[‘C2C’, ‘C2R’, ‘R2C’] | None 
 
 - inplace#
- Specify if the operation is in-place ( - Trueor- False). The operand is overwritten by the result if- inplaceis- True. The default is- False.- Type:
 
 - last_axis_parity#
- For complex-to-real FFT (corresponding to - fft_type='C2R'), specify whether the size of the last axis in the result should be even or odd. The even size is calculated as \(2 * (m - 1)\), where \(m\) is the the size of the last axis of the operand, and the odd size is calculated as \(2 * (m - 1) + 1\). The specified value should be either- 'even'or- 'odd', with the default being- 'even'.- Type:
- Literal[‘even’, ‘odd’] 
 
 - result_layout#
- The layout to use for the result, either - 'natural'or- 'optimized'. For the- 'natural'option, the result layout is the same as that of the operand. The default is- 'optimized', which generally provides much better performance and should be used if the user doesn’t care about the result layout matching the operand layout. However in rare cases, depending on the device type, shape and strides of the operand, and the FFT dimensions, the- 'natural'layout may perform better. This option is ignored if- inplaceis specified to be True.- Type:
- Literal[‘natural’, ‘optimized’] 
 
 - device_id#
- CUDA device ordinal (used if the operand resides on the CPU). Device 0 will be used if not specified. - Deprecated since version 0.2.0: The - device_idshould be specified as- executionoption, see- ExecutionCUDA.device_id.- Type:
- int | None 
 
 - logger#
- Python Logger object. The root logger will be used if a logger object is not provided. - Type:
 
 - blocking#
- A flag specifying the behavior of the execution functions and methods, such as - fft()and- FFT.execute(). When- blockingis- True, the execution methods do not return until the operation is complete. When- blockingis- "auto", the methods return immediately when the input tensor is on the GPU and- executionis set to ‘CUDA’. The execution methods always block when the input tensor is on the CPU or- executionis specified to ‘CPU’ to ensure that the user doesn’t inadvertently use the result before it becomes available. The default is- "auto".- Type:
- Literal[True, ‘auto’] 
 
 - allocator#
- An object that supports the - BaseCUDAMemoryManagerprotocol, used to draw device memory. If an allocator is not provided, a memory allocator from the library package will be used (- torch.cuda.caching_allocator_alloc()for PyTorch operands,- cupy.cuda.alloc()otherwise). Currently, CPU execution does not allow specifying a memory pool.- Type:
 
 - See also - ExecutionCUDA,- ExecutionCPU,- FFT,- fft(),- ifft(),- rfft(), and- irfft().