   int i_step = blockDim.x;
   int k = blockIdx.x;
   float *gradInput_k = gradInput + k*nInput;
-  float *nodeGrad, *nodeWeight, *nodeBias;
-  float gradOutput_k = gradOutput[k];
+  float *nodeGrad, *nodeWeight;
+  float grad = gradOutput[k];
   int childId = target[k] - 1;
   int parentId, parentIdx, childIdx, nChildren;
-  //int nOutput;
   float *node;
   int n = 0;
 

  if(errcode != cudaSuccess)
    THError(cudaGetErrorString(errcode));
  
  //THCudaTensor_free(input);
  return 1;
}


  }
}



static int cunnx_SoftMaxTree_updateOutput(lua_State *L)
{ 
  THCudaTensor *input = (THCudaTensor*)luaT_checkudata(L, 2, "torch.CudaTensor");  
  THCudaTensor *target = (THCudaTensor*)luaT_checkudata(L, 3, "torch.CudaTensor");  
  int inputSize = luaT_getfieldcheckint(L, 1, "inputSize");
  int rootId = luaT_getfieldcheckint(L, 1, "rootId") - 1;
