Commit dc56fd67 by xiaotong

clean useless code

parent 49869ae5
......@@ -870,7 +870,6 @@ int T2TTrainer::LoadBatchMT(FILE * file,
int sCount = sc/2;
int seqSize = 0;
int dimsEnc[3] = {sCount, maxEnc, vsEnc};
int dimsDec[3] = {sCount, maxDec, vsDec};
InitTensor2D(batchEnc, sCount, maxEnc, X_INT, devID, mem);
......@@ -900,8 +899,6 @@ int T2TTrainer::LoadBatchMT(FILE * file,
int len = seqLen[s];
int sent = (s - seq)/2;
for(int w = 0; w < len; w++){
//batchEnc->Set2DInt(buf[seqOffset[s] + w], sent, w);
//paddingEnc->Set2D(1.0F, sent, w);
int num = buf[seqOffset[s] + w];
batchEncOffsets[wCount] = batchEnc->GetOffset2D(sent, w);
......@@ -923,27 +920,20 @@ int T2TTrainer::LoadBatchMT(FILE * file,
CheckNTErrors(len <= maxDec, "Something is wrong!");
int sent = (s - seq - 1)/2;
for(int w = 0; w < len; w++){
//batchDec->Set2DInt(buf[seqOffset[s] + w], sent, w);
//paddingDec->Set2D(1.0F, sent, w);
int num = buf[seqOffset[s] + w];
batchDecOffsets[wCountDec] = batchDec->GetOffset2D(sent, w);
batchDecValues[wCountDec] = num;
paddingDecOffsets[wCountDec] = paddingDec->GetOffset2D(sent, w);
if (w > 0) {
//gold->Set3D(1.0F, sent, w - 1, buf[seqOffset[s] + w]);
if (w > 0)
goldOffsets[wGold++] = gold->GetOffset3D(sent, w - 1, buf[seqOffset[s] + w]);
}
if (w == len - 1) {
if (isDoubledEnd) {
//gold->Set3D(1.0F, sent, w, buf[seqOffset[s] + w]);
if (isDoubledEnd)
goldOffsets[wGold++] = gold->GetOffset3D(sent, w, buf[seqOffset[s] + w]);
}
else {
//gold->Set3D(1.0F, sent, w, buf[seqOffset[s] + w + 1]);
else
goldOffsets[wGold++] = gold->GetOffset3D(sent, w, buf[seqOffset[s] + w + 1]);
}
}
wCount++;
wCountDec++;
......
......@@ -71,8 +71,6 @@ void _Gather(XTensor * s, XTensor * t, XTensor * srcIndex)
}
#endif
int blockNum = 1;
int blockSize = 1;
int stride = 1;
int indexSize = 1;
......@@ -139,4 +137,4 @@ XTensor Gather(XTensor &s, XTensor &index)
}
}
} // namespace nts(NiuTrans.Tensor)
\ No newline at end of file
} // namespace nts(NiuTrans.Tensor)
......@@ -224,8 +224,6 @@ void _SpreadForGather(XTensor * source, XTensor * collection, XTensor * index)
}
#endif
int blockNum = 1;
int blockSize = 1;
int stride = 1;
int indexSize = 1;
......@@ -243,4 +241,4 @@ void _SpreadForGather(XTensor * source, XTensor * collection, XTensor * index)
}
}
} // namespace nts(NiuTrans.Tensor)
\ No newline at end of file
} // namespace nts(NiuTrans.Tensor)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论