class_docstr: Fast Fourier Transform.
  
  .. TODO:
      The current implementation just works for matrix inputs, and permits
      taking a 1D FFT over either rows or columns. Add support for N-D FFTs
      as provided by either numpy or FFTW directly.
  
  .. TODO:
      Give the C code that uses FFTW.
  
  .. TODO:
      Unit tests.
class_docstr_tok: ["Fast","Fourier","Transform",".","..","TODO",":","The","current","implementation","just","works","for","matrix","inputs",",","and","permits","taking","a","1D","FFT","over","either","rows","or","columns",".","Add","support","for","N-D","FFTs","as","provided","by","either","numpy","or","FFTW","directly",".","..","TODO",":","Give","the","C","code","that","uses","FFTW",".","..","TODO",":","Unit","tests","."]
code: def perform(self, node, inp, out):
      frames, n, axis = inp
      spectrogram, buf = out
      if self.inverse:
          fft_fn = numpy.fft.ifft
      else:
          fft_fn = numpy.fft.fft
  
      fft = fft_fn(frames, int(n), int(axis))
      if self.half:
          M, N = fft.shape
          if axis == 0:
              if M % 2:
                  raise ValueError(
                      "halfFFT on odd-length vectors is undefined"
                  )
              spectrogram[0] = fft[0 : M / 2, :]
          elif axis == 1:
              if N % 2:
                  raise ValueError(
                      "halfFFT on odd-length vectors is undefined"
                  )
              spectrogram[0] = fft[:, 0 : N / 2]
          else:
              raise NotImplementedError()
      else:
          spectrogram[0] = fft
  
file_path: Theano/theano/sandbox/fourier.py
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import numpy.fft
  from six.moves import xrange
  from theano import tensor
  from theano.gof import Op, Apply, generic
  import warnings
label_desc: Use image node_id 3 for calling the FFT obj's underlying member method code with example usage: obj.perform(node, inp, out) without return types