diff options
author | Luke Hutton <luke.hutton@arm.com> | 2023-01-09 10:41:33 +0000 |
---|---|---|
committer | Luke Hutton <luke.hutton@arm.com> | 2023-01-17 11:05:24 +0000 |
commit | 13ede1df912c7adc59535036103a2da640613bfe (patch) | |
tree | 6411db9eb1bbeff870df8e9dcd24701bf0b6bbf3 | |
parent | a269fd4c806ca0c08123a640132be02dbe86fa7c (diff) | |
download | specification-13ede1df912c7adc59535036103a2da640613bfe.tar.gz |
RFFT2D: Adjust output height to be same as the input
The expected output shape of RFFT2d should be (N, H, W/2+1) as
opposed to (N, H/2+1, W/2+1).
Change-Id: I66d830f1ffa86417b57572b3cd904db0290cac42
-rw-r--r-- | chapters/tensor_ops.adoc | 10 | ||||
-rw-r--r-- | tools/dictionary.dic | 1 | ||||
-rw-r--r-- | tosa.xml | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/chapters/tensor_ops.adoc b/chapters/tensor_ops.adoc index b8527bf..cb268fa 100644 --- a/chapters/tensor_ops.adoc +++ b/chapters/tensor_ops.adoc @@ -338,10 +338,12 @@ for_each(0 <= n < N, 0 <= oy < H, 0 <= ox < W, 0 <= c < C ) { Performs a batched 2D real-valued Fast Fourier Transform over the input where the input tensor consists of real values producing complex valued output. The complex output values will be split into the output_real and output_imag tensor arguments. -RFFT2D takes advantage of Hermitian symmetry to only calculate the first half of the output. -Imaginary values with locations h=0,H/2 or w=0,W/2 are zero. +RFFT2D takes advantage of Hermitian symmetry to only calculate the first half of the final output axis. +Imaginary values with locations (0,0), (0,W/2), (H/2,0) and (H/2,W/2) are zero. -image::forward_fft2d.svg["forward FFT definition", align="center"] +// output[h][w] = \sum_{m=0}^{H-1}\sum_{n=0}^{W-1}input[m][n] * \exp\left(-2\pi i\left(\frac{mh}{H} + \frac{nw}{W}\right)\right) + +image::forward_fft2d.svg["forward RFFT definition", align="center"] include::{generated}/operators/RFFT2D.adoc[] @@ -350,7 +352,7 @@ include::{generated}/operators/RFFT2D.adoc[] ERROR_IF(!power_of_two(H)); ERROR_IF(!power_of_two(W)); -for_each(0 <= n < N, 0 <= oy < H/2 + 1, 0 <= ox < W/2 + 1) { +for_each(0 <= n < N, 0 <= oy < H, 0 <= ox < W/2 + 1) { in_out_t sum_real = 0.0; in_out_t sum_imag = 0.0; for_each(0 <= iy < H, 0 <= ix < W) { diff --git a/tools/dictionary.dic b/tools/dictionary.dic index 5f53b0c..4fa9ffd 100644 --- a/tools/dictionary.dic +++ b/tools/dictionary.dic @@ -56,6 +56,7 @@ Rescale RESCALE rescaled RFFT +rfft RSQRT sigmoid Sigmoid @@ -468,10 +468,10 @@ <levellimit value="H" limit="MAX_KERNEL"/> <levellimit value="W" limit="MAX_KERNEL"/> </argument> - <argument category="output" name="output_real" type="in_out_t*" shape="[N,H/2 + 1,W/2 + 1]"> + <argument category="output" name="output_real" type="in_out_t*" shape="[N,H,W/2 + 1]"> <description>Real part of the complex output</description> </argument> - <argument category="output" name="output_imag" type="in_out_t*" shape="[N,H/2 + 1,W/2 + 1]"> + <argument category="output" name="output_imag" type="in_out_t*" shape="[N,H,W/2 + 1]"> <description>Imaginary part of the complex output.</description> </argument> </arguments> |