Theano/Theano — pull request #1904 by f0k (2014-06-06 14:01:29+00:00)
Title: FFT convolution: make optimization support uneven image width

Hey,

this is a collection of a few minor fixes/enhancements regarding `conv2d_fft` (by the way, thanks a lot to Sander for starting it and to everybody else involved in making this happen!):

* For me, `nosetests theano/sandbox/cuda/tests/test_fftconv.py` always resulted in a failure because `test_full` happened to be executed before `test_opt_full` or `test_opt_valid`, so `theano.sandbox.cuda.fftconv` hadn't been imported by anybody yet. Fixed by explicitly importing it in the beginning of the file. Let me know if the import needs to be conditional instead and I'll change it.
* It was a bit cumbersome to find out that I don't only need `scikits.cuda`, but even the current development version. Documented that.
* While reading the code, I noticed that `ConvOp` allows an image and filter shape specification with some entries set to `None` to indicate that they are not known at compile time. This is passed on to `GpuConv` in the `local_gpu_conv` optimizer, but `GpuConv` assumed it either had no shape specification or a fully qualified shape specification. Added an extra check where needed.
* When using the `conv_fft_valid` and `conv_fft_full` optimizers on a graph that had convolution input images with uneven image width, it would happily create a graph that doesn't run (i.e., it compiles, but barks when executed). Changed the optimizers to check for uneven image width if the image width was given at compile time, and use the `pad_last_dim` argument to `conv2d_fft()` if needed.

Sorry for putting this in a single pull request, I can split things if needed.

Cheers, Jan