module onnxrt.ops_cpu.op_dft#

Inheritance diagram of mlprodict.onnxrt.ops_cpu.op_dft

Short summary#

module mlprodict.onnxrt.ops_cpu.op_dft

Runtime operator.

source on GitHub

Classes#

class

truncated documentation

DFT

DFT === Computes the discrete Fourier transform of input. Attributes

Functions#

function

truncated documentation

_cfft

_cifft

_fft

_ifft

Properties#

property

truncated documentation

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default_modified

Returns the list of modified parameters.

args_mandatory

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

atts_value

Returns all parameters in a dictionary.

Methods#

method

truncated documentation

__init__

_run

Documentation#

Runtime operator.

source on GitHub

class mlprodict.onnxrt.ops_cpu.op_dft.DFT(onnx_node, desc=None, **options)#

Bases: OpRun

===

Computes the discrete Fourier transform of input.

Attributes

  • axis: The axis on which to perform the DFT. By default this value is set to 1, which corresponds to the first dimension after the batch index. Default value is nameaxisi1typeINT (INT)

  • inverse: Whether to perform the inverse discrete fourier transform. By default this value is set to 0, which corresponds to false. Default value is nameinversei0typeINT (INT)

  • onesided: If onesided is 1, only values for w in [0, 1, 2, …, floor(n_fft/2) + 1] are returned because the real-to-complex Fourier transform satisfies the conjugate symmetry, i.e., X[m, w] = X[m,w]=X[m,n_fft-w]*. Note if the input or window tensors are complex, then onesided output is not possible. Enabling onesided with real inputs performs a Real-valued fast Fourier transform (RFFT). When invoked with real or complex valued input, the default value is 0. Values can be 0 or 1. Default value is nameonesidedi0typeINT (INT)

Inputs

Between 1 and 2 inputs.

  • input (heterogeneous)T1: For real input, the following shape is expected: [batch_idx][signal_dim1][signal_dim2]…[signal_dimN][1]. For complex input, the following shape is expected: [batch_idx][signal_dim1][signal_dim2]…[signal_dimN][2]. The first dimension is the batch dimension. The following N dimentions correspond to the signal’s dimensions. The final dimension represents the real and imaginary parts of the value in that order.

  • dft_length (optional, heterogeneous)T2: The length of the signal.If greater than the axis dimension, the signal will be zero-padded up to dft_length. If less than the axis dimension, only the first dft_length values will be used as the signal. It’s an optional value.

Outputs

  • output (heterogeneous)T1: The Fourier Transform of the input vector.If onesided is 0, the following shape is expected: [batch_idx][signal_dim1][signal_dim2]…[signal_dimN][2]. If axis=0 and onesided is 1, the following shape is expected: [batch_idx][floor(signal_dim1/2)+1][signal_dim2]…[signal_dimN][2]. If axis=1 and onesided is 1, the following shape is expected: [batch_idx][signal_dim1][floor(signal_dim2/2)+1]…[signal_dimN][2]. If axis=N-1 and onesided is 1, the following shape is expected: [batch_idx][signal_dim1][signal_dim2]…[floor(signal_dimN/2)+1][2]. The signal_dim at the specified axis is equal to the dft_length.

Type Constraints

  • T1 tensor(float16), tensor(float), tensor(double), tensor(bfloat16): Constrain input and output types to float tensors.

  • T2 tensor(int32), tensor(int64): Constrain scalar length types to int64_t.

Version

Onnx name: DFT

This version of the operator has been available since version 17.

Runtime implementation: DFT

__init__(onnx_node, desc=None, **options)#
_run(x, dft_length=None, attributes=None, verbose=0, fLOG=None)#

Should be overwritten.

source on GitHub

mlprodict.onnxrt.ops_cpu.op_dft._cfft(x, fft_length, axis, onesided=False, normalize=False)#
mlprodict.onnxrt.ops_cpu.op_dft._cifft(x, fft_length, axis=-1, onesided=False)#
mlprodict.onnxrt.ops_cpu.op_dft._fft(x, fft_length, axis)#
mlprodict.onnxrt.ops_cpu.op_dft._ifft(x, fft_length, axis=-1, onesided=False)#