Theano/Theano — pull request #2126 by benanne (2014-09-25 12:44:54+00:00)
Title: add support for border_mode='half' to cudnn

I added support for a 'half' `border_mode` to the cudnn convolution implementation. I didn't want to call it 'same' because it only gives the same output feature map dimensionality if the filter sizes are odd. If they are even, the output feature map dimensionality is one larger than the input.

For example:
input shape (64, 128, 32, 32), filter shape (256, 128, **5**, **5**) will result in an output shape of (64, 256, **32**, **32**)
input shape (64, 128, 32, 32), filter shape (256, 128, **6**, **6**) will result in an output shape of (64, 256, **33**, **33**)

Unfortunately implementing a true 'same' convolution is a bit more involved and the definition is a bit ambiguous.

I also had a look into adding some tests for this, but it seems that tests for convolutions with different border modes are a bit involved, so I haven't attempted this yet. It looks like I'd have to add a `_test_half` function in `test_conv_cuda_ndarray.py`?