diff options
Diffstat (limited to 'chapters/tensor_ops.adoc')
-rw-r--r-- | chapters/tensor_ops.adoc | 10 |
1 files changed, 6 insertions, 4 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) { |