@@ -339,11 +403,25 @@ class GpuImages2Neibs(Images2Neibs):
...
@@ -339,11 +403,25 @@ class GpuImages2Neibs(Images2Neibs):
const int c = *(dtype_%(neib_shape)s*) PyArray_GETPTR1(%(neib_shape)s, 0);
const int c = *(dtype_%(neib_shape)s*) PyArray_GETPTR1(%(neib_shape)s, 0);
const int d = *(dtype_%(neib_shape)s*) PyArray_GETPTR1(%(neib_shape)s, 1);
const int d = *(dtype_%(neib_shape)s*) PyArray_GETPTR1(%(neib_shape)s, 1);
const int step_x = c;//will change when we implement neib_step
const int step_y = d;//will change when we implement neib_step
//const float * cd = CudaNdarray_DEV_DATA(%(neib_shape)s);
if ( "%(mode)s" == "wrap_centered") {
//const int c = (int) cd[0];
if (c%%2!=1 || d%%2!=1){
//const int d = (int) cd[1];
PyErr_Format(PyExc_TypeError, "Images2Neibs: in mode wrap_centered need patch with odd shapes");
%(fail)s;
}
if ( CudaNdarray_HOST_DIMS(%(ten4)s)[2] < c || CudaNdarray_HOST_DIMS(%(ten4)s)[3] < d)
{
PyErr_Format(PyExc_TypeError, "Images2Neibs: in wrap_centered mode, don't support image shapes smaller then the patch shapes: neib_shape=(%%d,%%d), ten4[2:]=[%%d,%%d]",