code: def test_grad(self):
      # The numerical gradient of the FFT is sensitive, must set large
      # enough epsilon to get good accuracy.
      eps = 1e-1
  
      def f_rfft(inp):
          return theano.gpuarray.fft.curfft(inp)
  
      inputs_val = np.random.random((1, N, N)).astype("float32")
      utt.verify_grad(f_rfft, [inputs_val], eps=eps, mode=mode_with_gpu)
  
      def f_irfft(inp):
          return theano.gpuarray.fft.cuirfft(inp)
  
      inputs_val = np.random.random((1, N, N // 2 + 1, 2)).astype(
          "float32"
      )
      utt.verify_grad(
          f_irfft, [inputs_val], eps=eps, mode=mode_with_gpu
      )
  
      def f_rfft(inp):
          return theano.gpuarray.fft.curfft(inp, norm="ortho")
  
      inputs_val = np.random.random((1, N, N)).astype("float32")
      utt.verify_grad(f_rfft, [inputs_val], eps=eps, mode=mode_with_gpu)
  
      def f_irfft(inp):
          return theano.gpuarray.fft.cuirfft(inp, norm="no_norm")
  
      inputs_val = np.random.random((1, N, N // 2 + 1, 2)).astype(
          "float32"
      )
      utt.verify_grad(
          f_irfft, [inputs_val], eps=eps, mode=mode_with_gpu
      )
  
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 6 for calling the TestFFT obj's underlying member method code with example usage: obj.test_grad() and returns: theano, theano, theano, theano