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);
......
......@@ -212,8 +212,6 @@ void T2TSearch::Score(T2TStateBundle * prev, T2TStateBundle * beam)
lp = T2TLengthPenalizer::GNMT(len, alpha);
lp.Reshape(lp.unitNum);
lp.Dump(stderr, "lp:");
/* score = log-prob/lp */
_DivDim(&probPath, &lp, &score, 0);
......@@ -291,10 +289,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);
......@@ -342,8 +336,6 @@ void T2TSearch::Generate(T2TStateBundle * beam)
probPathTopK.Reshape(1, probPathTopK.unitNum);
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);
......@@ -352,12 +344,6 @@ void T2TSearch::Generate(T2TStateBundle * beam)
probPathTopK.Reshape(order, dimsTopK);
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论