   luaL_argcheck(L, inputSize <= WINDOWSPARSE_MAXBLOCKSIZE, 1, "inputSize is too large");
   luaL_argcheck(L, outputSize <= WINDOWSPARSE_MAXBLOCKSIZE, 1, "inputSize is too large");
   
-  // expect contiguous inputs
-  
   THCudaTensor_resize2d(output, input->size[0], outputSize);
-  
-  THCudaTensor_addmvB(output, 0, 1, weight, input, inputIndice, outputIndice);
-  THCudaTensor* output_, *weight_, *_weight_, *input_;
-    
-  cublasStatus_t stat;
-  cublasHandle_t handle;
+    
   stat = cublasCreate(&handle);
   if (stat != CUBLAS_STATUS_SUCCESS) 
     THError("CUBLAS initialization failed");
-     
-  cudaStream_t streams[WINDOWSPARSE_STREAMS];
   
   for (int i=0; i<WINDOWSPARSE_STREAMS; i++)
   {

  // batchSize x outputWindowSize x outputSize
  THCudaTensor *output = (THCudaTensor*)luaT_getfieldcheckudata(L, 1, "output", "torch.CudaTensor");
  
  luaL_argcheck(L, input->nDimension == 3, 2, "3D(batch mode) tensor expected");
  luaL_argcheck(L, input->size[2] == inputSize, 2, "invalid input size"); 
  luaL_argcheck(L, inputIndice->nDimension == 2, 3, "2D(batch mode) tensor expected");

#define WINDOWSPARSE_MINBLOCKSIZE 32
#define WINDOWSPARSE_MINBLOCKS 32
#define WINDOWSPARSE_STREAMS 8


static int cunnx_WindowSparse_updateOutput(lua_State *L)
