   int i_step = blockDim.x;
   int k = blockIdx.x;
   float *input_k = input + k*nInput;
-  float *output_k = output + k*nInput;
+  float narrowsum = 0;
   int childId = (*(target+k)) - 1;
   int parentId, parentIdx, childIdx, nChildren;
   int nOutput;

  THIntTensor *childParent = (THIntTensor*)luaT_getfieldcheckudata(L, 1, "childParent", "torch.IntTensor");
  THIntTensor *parentChildren = (THIntTensor*)luaT_getfieldcheckudata(L, 1, "parentChildren", "torch.IntTensor");
  
  THCudaTensor *metadata = luaT_getfieldcheckudata(L, 1, "_linearOutput", "torch.CudaTensor");
  THFloatTensor *buffer = luaT_getfieldcheckudata(L, 1, "_buffer", "torch.FloatTensor");
  
  THCudaTensor *
  THFloatTensor *
  
  THCudaTensor *logsoftOutput = luaT_getfieldcheckudata(L, 1, "_logSoftMaxOutput", "torch.CudaTensor");
  
  THCudaTensor *weight = luaT_getfieldcheckudata(L, 1, "weight", "torch.CudaTensor");
  THCudaTensor *bias = luaT_getfieldcheckudata(L, 1, "bias", "torch.CudaTensor");

    }
    childId = parentId;
  }
  *output_k = narrowsum;
}

static int cunnx_SoftMaxTree_updateOutput(lua_State *L)
