nvmath.fft.rfft¶
- nvmath.fft.rfft(operand, axes=None, options=None, prolog=None, epilog=None, stream=None)[source]¶
Perform an N-D real-to-complex (R2C) FFT on the provided real operand.
- Parameters:
operand – A tensor (ndarray-like object). The currently supported types are
numpy.ndarray
,cupy.ndarray
, andtorch.Tensor
.axes – The dimensions along which the FFT is performed. Currently, it is required that the axes are contiguous and include the first or the last dimension. Only up to 3D FFTs are supported.
options – Specify options for the FFT as a
FFTOptions
object. Alternatively, adict
containing the parameters for theFFTOptions
constructor can also be provided. If not specified, the value will be set to the default-constructedFFTOptions
object.prolog – Provide device-callable function in LTO-IR format to use as load-callback as an object of type
DeviceCallable
. Alternatively, adict
containing the parameters for theDeviceCallable
constructor can also be provided. The default is no prolog.epilog – Provide device-callable function in LTO-IR format to use as store-callback as an object of type
DeviceCallable
. Alternatively, adict
containing the parameters for theDeviceCallable
constructor can also be provided. The default is no epilog.stream – Provide the CUDA stream to use for executing the operation. Acceptable inputs include
cudaStream_t
(as Pythonint
),cupy.cuda.Stream
, andtorch.cuda.Stream
. If a stream is not provided, the current stream from the operand package will be used.
- Returns:
A complex tensor that remains on the same device and belongs to the same package as the input operand. The extent of the last transformed axis in the result will be
operand.shape[axes[-1]] // 2 + 1
.