code: def test_1Drfft(self):
      inputs_val = np.random.random((1, N)).astype(
          pytensor.config.floatX
      )
  
      x = matrix("x")
      rfft = fft.rfft(x)
      f_rfft = pytensor.function([x], rfft)
      res_rfft = f_rfft(inputs_val)
      res_rfft_comp = np.asarray(res_rfft[:, :, 0]) + 1j * np.asarray(
          res_rfft[:, :, 1]
      )
  
      rfft_ref = np.fft.rfft(inputs_val, axis=1)
  
      utt.assert_allclose(rfft_ref, res_rfft_comp)
  
      m = rfft.type()
      print(m.ndim)
      irfft = fft.irfft(m)
      f_irfft = pytensor.function([m], irfft)
      res_irfft = f_irfft(res_rfft)
  
      utt.assert_allclose(inputs_val, np.asarray(res_irfft))
  
      # 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 fft.rfft(inp)
  
      inputs_val = np.random.random((1, N)).astype(
          pytensor.config.floatX
      )
      utt.verify_grad(f_rfft, [inputs_val], eps=eps)
  
      def f_irfft(inp):
          return fft.irfft(inp)
  
      inputs_val = np.random.random((1, N // 2 + 1, 2)).astype(
          pytensor.config.floatX
      )
      utt.verify_grad(f_irfft, [inputs_val], eps=eps)
  
file_path: pytensor/tests/tensor/test_fft.py
imports: import numpy
  import pytest
  import pytensor
  from pytensor.tensor import fft
  from pytensor.tensor.type import matrix
  from tests import unittest_tools
label_desc: Use image node_id 2 for calling the TestFFT obj's underlying member method code with example usage: obj.test_1Drfft() and returns: fft, fft