Commit b155f4c1 by xiaotong

correct the wrong index of dimension of words

parent 70d480ed
......@@ -90,7 +90,7 @@ void T2TSearch::Search(T2TModel * model, XTensor * input, XTensor * padding, XTe
encoding.SetName(ENCODING_NAME);
/* max output-length = 2 * source-length */
maxLength = input->GetDim(-2) * 2;
maxLength = input->GetDim(-1) * 2;
CheckNTErrors(maxLength > 0, "no max length specified!");
T2TStateBundle * states = new T2TStateBundle[maxLength + 1];
......@@ -256,7 +256,7 @@ void T2TSearch::Generate(T2TStateBundle * beam)
/* keep the most promissing candidates in the beam */
TopK(score, scoreTopK, index, -1, beamSize);
score.Dump(stderr, "score:");
//score.Dump(stderr, "score:");
scoreTopK.Dump(stderr, "topk:");
index.Dump(stderr, "index:");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论