Commit dc56fd67 by xiaotong

clean useless code

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