   THCTensor *columns = finput;
   THCTensor *ones = fgradInput;
   THCUNN_assertSameGPU(state, 6, input, output, weight, bias, columns, ones);
-
-  THCUNN_argCheck(state, input->nDimension == 4 || input->nDimension == 5, 2, input,
-                  "4D or 5D (batch mode) tensor expected for input, but got: %s");
-
-  THCUNN_argCheck(state, weight->nDimension == 5, 4, weight,
-                  "5D (nOutputPlane x nInputPlane x kT x kH x kW) tensor "
-                  "expected for weight, but got: %s");
+  THNN_(VolumetricConvolution_shapeCheck)(state, input, NULL, weight, NULL);
 
   int nOutputPlane = (int)weight->size[0];
   int nInputPlane  = (int)weight->size[1];

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

void THNN_(VolumetricConvolution_updateOutput)(
           THCState *state,

  THCTensor *ones = fgradInput;
  THCUNN_assertSameGPU(state, 6, input, gradOutput, gradWeight, gradBias, columns, ones);

  int nOutputPlane = (int)gradWeight->size[0];
  int nInputPlane  = (int)gradWeight->size[1];
  int kT           = (int)gradWeight->size[2];
  int kH           = (int)gradWeight->size[3];
  int kW           = (int)gradWeight->size[4];

  THNN_(VolumetricConvolution_shapeCheck)(state, input, gradOutput, NULL, gradWeight);


  int batch = 1;
  if (input->nDimension == 4)
