fastFourierTransform(_:axesTensor:descriptor:name:)
Creates a fast Fourier transform operation and returns the result tensor.
Declaration
func fastFourierTransform(_ tensor: MPSGraphTensor, axesTensor: MPSGraphTensor, descriptor: MPSGraphFFTDescriptor, name: String?) -> MPSGraphTensorParameters
- tensor:
A complex or real-valued input tensor.
- axesTensor:
A tensor of rank one containing the axes over which MPSGraph performs the transformation. See Fastfouriertransform(_:axes:descriptor:name:).
- descriptor:
A descriptor that defines the parameters of the Fourier transform operation - see Mpsgraphfftdescriptor.
- name:
The name for the operation.
Return Value
A valid complex-valued MPSGraphTensor of the same shape as tensor.
Discussion
This operation computes the fast Fourier transform of the input tensor according to the following formulae.
output[mu] = scale * sum_nu exp( +/- i * 2Pi * mu * nu / n ) input[nu], wherescale = 1 for scaling_mode = none, scale = 1/V_f for scaling_mode = size, scale = 1/sqrt(V_f) for scaling_mode = unitary, where V_f is the volume of the transformation defined by the dimensions included in axes (V_f = prod_{i \in axes} shape(input)[i]) (see scalingMode), + is selected in +/- when inverse is specified, otherwise - is used and the sum is done separately over each dimension in axes and n is the dimension length of that axis.