code: def test_norm(self):
      inputs_val = np.random.random((1, N, N)).astype("float32")
      inputs = theano.shared(inputs_val)
  
      # Unitary normalization
      rfft = theano.gpuarray.fft.curfft(inputs, norm="ortho")
      f_rfft = theano.function([], rfft, mode=mode_with_gpu)
      res_rfft = f_rfft()
      res_rfft_comp = np.asarray(
          res_rfft[:, :, :, 0]
      ) + 1j * np.asarray(res_rfft[:, :, :, 1])
  
      rfft_ref = np.fft.rfftn(inputs_val, axes=(1, 2))
  
      utt.assert_allclose(
          rfft_ref / N, res_rfft_comp, atol=1e-4, rtol=1e-4
      )
  
      # No normalization
      rfft = theano.gpuarray.fft.curfft(inputs, norm="no_norm")
      f_rfft = theano.function([], rfft, mode=mode_with_gpu)
      res_rfft = f_rfft()
      res_rfft_comp = np.asarray(
          res_rfft[:, :, :, 0]
      ) + 1j * np.asarray(res_rfft[:, :, :, 1])
  
      utt.assert_allclose(rfft_ref, res_rfft_comp, atol=1e-4, rtol=1e-4)
  
      # Inverse FFT inputs
      inputs_val = np.random.random((1, N, N // 2 + 1, 2)).astype(
          "float32"
      )
      inputs = theano.shared(inputs_val)
      inputs_ref = inputs_val[:, :, :, 0] + 1j * inputs_val[:, :, :, 1]
  
      # Unitary normalization inverse FFT
      irfft = theano.gpuarray.fft.cuirfft(inputs, norm="ortho")
      f_irfft = theano.function([], irfft, mode=mode_with_gpu)
      res_irfft = f_irfft()
  
      irfft_ref = np.fft.irfftn(inputs_ref, axes=(1, 2))
  
      utt.assert_allclose(
          irfft_ref * N, res_irfft, atol=1e-4, rtol=1e-4
      )
  
      # No normalization inverse FFT
      irfft = theano.gpuarray.fft.cuirfft(inputs, norm="no_norm")
      f_irfft = theano.function([], irfft, mode=mode_with_gpu)
      res_irfft = f_irfft()
  
      utt.assert_allclose(
          irfft_ref * N**2, res_irfft, atol=1e-4, rtol=1e-4
      )
  
file_path: Theano/theano/gpuarray/tests/test_fft.py
imports: from __future__ import absolute_import, print_function, division
  import unittest
  import numpy
  import theano
  import theano.tensor
  from theano.tests import unittest_tools
  import theano.gpuarray.fft
  from .config import mode_with_gpu
  from nose.plugins.skip import SkipTest
  from theano.gpuarray.fft import pygpu_available, skcuda_available, pycuda_available
label_desc: Use image node_id 5 for calling the TestFFT obj's underlying member method code with example usage: obj.test_norm() without return types