Fix crash in DeepCopyOp
When using memset in GpuAlloc, use only contiguous output
Use provided output memory if not contiguous

It may be slower than allocated new memory and calling memset,
but if that non-contiguous memory was provided, it is probable
that the output will end up being copied into that non-contiguous
memory, and that would be even slower.
Fix problem with negative strides in GpuDownSample...

To be able to use negative offsets in indexing, threadIdx.x (and y)
should be cast to signed int.
Fix GpuDownSample...Grad with non-contiguous output memory
Update k_copy_4d to work with bigger tensors
Compare to None, instead of testing an array as a boolean
Fix crash when output memory is not c-contiguous.

Also set Python Exceptions before failing.