    size_t workspaceMem = device->getMemory()/device->getNumConvKernels();
 
    int strideX, strideY;
+   int actualXBorder, actualYBorder;
+   assert(params.preNblt == params.preNbrt);
+   assert(params.preNbup == params.preNbdn);
    //One to many case
    if(preToPostScaleX < 1){
       float fmanyScale = (float)1/params.preToPostScaleX;

   cudnnHandleError(status, "Set filter tensor descriptor");
   params.v_filterDescriptor = (void*)filterDescriptor;

   //There's the case where the border of pre is made bigger through other connections. Need to calculate difference
   //between current recv border and actual recv border
   int actualXBorder = (params.nxp-params.preToPostScaleX)/2;
   int actualYBorder = (params.nyp-params.preToPostScaleY)/2;

   assert(params.preNblt == params.preNbrt);
   assert(params.preNbup == params.preNbdn);

   int diffX = actualXBorder - params.preNblt;
   int diffY = actualYBorder - params.preNbup;

   assert(diffX <= 0 && diffY <= 0);

   //Set convolution descriptor
   cudnnConvolutionDescriptor_t convDescriptor;

      assert(ceilf(preToPostScaleY) == preToPostScaleY);
      strideX = preToPostScaleX;
      strideY = preToPostScaleY;

      //There's the case where the border of pre is made bigger through other connections. Need to calculate difference
      //between current recv border and actual recv border
      actualXBorder = (params.nxp-params.preToPostScaleX)/2;
      actualYBorder = (params.nyp-params.preToPostScaleY)/2;
   }

   int diffX = actualXBorder - params.preNblt;
   int diffY = actualYBorder - params.preNbup;


   //assert(diffX <= 0 && diffY <= 0);

   //Set up pre descriptor
   cudnnTensorDescriptor_t inputDescriptor;
