Commit 4565ff2b by xiaotong

clean the code

parent cfa653cd
......@@ -202,12 +202,6 @@ void T2TPredictor::Predict(T2TStateBundle * next, XTensor * encoding,
/* decoder mask */
m->MakeMTMaskDec(*inputEnc, inputDec, *paddingEnc, paddingDec, maskDec, maskEncDec);
//inputEnc->Dump(stderr, "inputenc:");
//paddingEnc->Dump(stderr, "paddingenc:");
inputDec.Dump(stderr, "inputdec: ");
//maskDec.Dump(stderr, "maskdec: ");
//maskEncDec.Dump(stderr, "mask-enc-dec: ");
/* make the decoding network */
decoding = decoder.Make(inputDec, *encoding, maskDec, maskEncDec, false);
......
......@@ -213,8 +213,6 @@ void T2TSearch::Score(T2TStateBundle * prev, T2TStateBundle * beam)
lp.Reshape(lp.unitNum);
lp.Dump(stderr, "lp:");
/* score = log-prob/lp */
_DivDim(&probPath, &lp, &score, 0);
......@@ -292,10 +290,6 @@ void T2TSearch::Generate(T2TStateBundle * beam)
/* keep the most promissing candidates in the beam */
TopK(score, scoreTopK, index, -1, beamSize);
//score.Dump(stderr, "score:");
scoreTopK.Dump(stderr, "topk:");
index.Dump(stderr, "index:");
CopyValues(index, preID);
/* "preID" represents the id (or the offset) of previous state used to make the current
......@@ -343,8 +337,6 @@ void T2TSearch::Generate(T2TStateBundle * beam)
prob.Reshape(1, prob.unitNum);
probTopK.Reshape(1, probTopK.unitNum);
indexCPU.Dump(stderr, "indexCPU:");
_Gather(&probPath, &probPathTopK, probPathTopK.order - 1, (int*)indexCPU.data, indexCPU.unitNum);
_Gather(&prob, &probTopK, probTopK.order - 1, (int*)indexCPU.data, indexCPU.unitNum);
......@@ -353,12 +345,6 @@ void T2TSearch::Generate(T2TStateBundle * beam)
prob.Reshape(order, dims);
probTopK.Reshape(order, dimsTopK);
indexCPU.Dump(stderr, "indexcpu:");
scoreTopK.Dump(stderr, "scoretopk:");
probPathTopK.Dump(stderr, "probpathtopk:");
probTopK.Dump(stderr, "probtopk:");
probPath = probPathTopK;
prob = probTopK;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论