     nInputPlane = input->size[1];
     batchSize = input->size[0];
   }
-
-  THArgCheck(nInputCols >= kW - 2 * padW && nInputRows >= kH - 2 * padH, 2,
-             "input image smaller than (kernel size - 2 * padW). Got "
-             "inputHeight: %nInputCols inputWidth: %d kH %d kW %d padH %d padW %d",
-             nInputRows, nInputCols, kH, kW, padH, padW);
 
   if(ceil_mode) {
     nOutputCols = ceil(float(nInputCols - kW + 2*padW) / float(dW)) + 1;

#ifndef THC_GENERIC_FILE
#define THC_GENERIC_FILE "generic/SpatialAveragePooling.cu"
#else

void THNN_(SpatialAveragePooling_updateOutput)(
           THCState *state,

           bool count_include_pad)
{
  THCUNN_assertSameGPU(state, 3, input, gradOutput, gradInput);
  THNN_(SpatialAveragePooling_shapeCheck)
       (state, input, gradOutput, kH, kW, dH, dW,
        padH, padW, ceil_mode);

  input = THCTensor_(newContiguous)(state, input);
  gradOutput = THCTensor_(newContiguous)(state, gradOutput);
