Normalizing FFT

3DTOPO: <p>I am trying to use torch.fft with 2D images. The problem is when I use 2D FFT tensors that are not the same exact dimensions of what my network was trained with, they are not in the same ballpark so inference is failing.</p>
<p>When I have normalized set to True, I am getting drastically different results for the same tensor with different dimensions.</p>
<p>For example, both the attached plots were created identically with torch.fft(). The only thing different is the dimension of one input image is 896 and the other 448.</p>
<p>I can change the power of the FFT signal using division/multiplication, but I cannot figure out how to make it so both use the same frequencies - which seems like it must be possible somehow. The smaller image cycles/px is ~double the larger image. When I search for shifting FFT frequency, all the results are about fftshift() which is not what I need as far as I can tell.</p>
<p>Dimensions 448:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/8/c/8cf1020f03f09af89c263bc35a1b522fa8c788e6.png" data-download-href="https://discuss.pytorch.org/uploads/default/8cf1020f03f09af89c263bc35a1b522fa8c788e6" title="tiger448"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/8/c/8cf1020f03f09af89c263bc35a1b522fa8c788e6_2_500x500.png" alt="tiger448" data-base62-sha1="k6PcB8MlFd6Hy5P7msfpS7KUohE" width="500" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/8/c/8cf1020f03f09af89c263bc35a1b522fa8c788e6_2_500x500.png, https://discuss.pytorch.org/uploads/default/optimized/3X/8/c/8cf1020f03f09af89c263bc35a1b522fa8c788e6_2_750x750.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/8/c/8cf1020f03f09af89c263bc35a1b522fa8c788e6_2_1000x1000.png 2x" data-dominant-color="5B6350"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">tiger448</span><span class="informations">4000×4000 1.72 MB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>Dimensions 896:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/3/a/3af22ad333a35921102345d2c6d089be1de33eb6.png" data-download-href="https://discuss.pytorch.org/uploads/default/3af22ad333a35921102345d2c6d089be1de33eb6" title="tiger896"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/3/a/3af22ad333a35921102345d2c6d089be1de33eb6_2_500x500.png" alt="tiger896" data-base62-sha1="8psx7R38uYN1TQV3AuTm8nnzyMm" width="500" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/3/a/3af22ad333a35921102345d2c6d089be1de33eb6_2_500x500.png, https://discuss.pytorch.org/uploads/default/optimized/3X/3/a/3af22ad333a35921102345d2c6d089be1de33eb6_2_750x750.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/3/a/3af22ad333a35921102345d2c6d089be1de33eb6_2_1000x1000.png 2x" data-dominant-color="575A4D"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">tiger896</span><span class="informations">2000×2000 3.28 MB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>