   THCudaTensor *gradOutputWindow;
   THCudaTensor *inputWindow;
   long k, i;
-  
+
   int dimS = 0; // sequence dimension
-  
-  if (gradOutput->nDimension == 3) 
+
+  if (gradOutput->nDimension == 3)
   {
     dimS = 1;
   }
-  
+
   nInputFrame = input->size[dimS];
   nOutputFrame = gradOutput->size[dimS];
 

        long nFrame = (nInputFrame-k*dW-kW)/inputFrameStride + 1;
        nOutputSampleFrame -= nFrame;

        THCudaTensor_setStorage2d(gradOutputWindow, gradOutputSample->storage, 
                                gradOutputSample->storageOffset + k*gradOutputSample->size[1],
                                nFrame, outputFrameStride*gradOutputSample->size[1],
                                gradOutputSample->size[1], 1);

      long nFrame = (nInputFrame-k*dW-kW)/inputFrameStride + 1;
      nOutputFrame -= nFrame;

      THCudaTensor_setStorage2d(gradOutputWindow, gradOutput->storage,
                              gradOutput->storageOffset + k*gradOutput->size[1],
                              nFrame, outputFrameStride*gradOutput->size[1],
                              gradOutput->size[1], 1);
