提交 aaff2ddd 编写于 作者: D dangqingqing

remove comments.

上级 cc5f0951
...@@ -30,8 +30,6 @@ using namespace std; // NOLINT ...@@ -30,8 +30,6 @@ using namespace std; // NOLINT
using autotest::TensorCheckEqual; using autotest::TensorCheckEqual;
using autotest::TensorCheckErr; using autotest::TensorCheckErr;
// clang-format off
void testMatrixMaxSequence(int batchSize, int inputDim) { void testMatrixMaxSequence(int batchSize, int inputDim) {
// forward // forward
MatrixPtr cpuInput = std::make_shared<CpuMatrix>(batchSize, inputDim); MatrixPtr cpuInput = std::make_shared<CpuMatrix>(batchSize, inputDim);
...@@ -1160,11 +1158,10 @@ void testBatch2seqPadding(int batchSize, int inputDim) { ...@@ -1160,11 +1158,10 @@ void testBatch2seqPadding(int batchSize, int inputDim) {
cpuOutput->zero(); cpuOutput->zero();
gpuOutput->zero(); gpuOutput->zero();
size_t maxSeqLen = 0; size_t maxSeqLen = 0;
size_t numSeq = cpuSequence->getSize() - 1; size_t numSeq = cpuSequence->getSize() - 1;
maxSeqLen = *std::max_element( maxSeqLen = *std::max_element(cpuSequence->getData(),
cpuSequence->getData(), cpuSequence->getData() + numSeq); cpuSequence->getData() + numSeq);
MatrixPtr cBatch = std::make_shared<CpuMatrix>(numSeq * maxSeqLen, inputDim); MatrixPtr cBatch = std::make_shared<CpuMatrix>(numSeq * maxSeqLen, inputDim);
MatrixPtr gBatch = std::make_shared<GpuMatrix>(numSeq * maxSeqLen, inputDim); MatrixPtr gBatch = std::make_shared<GpuMatrix>(numSeq * maxSeqLen, inputDim);
...@@ -1180,8 +1177,6 @@ void testBatch2seqPadding(int batchSize, int inputDim) { ...@@ -1180,8 +1177,6 @@ void testBatch2seqPadding(int batchSize, int inputDim) {
true); true);
cCheck->copyFrom(*gBatch); cCheck->copyFrom(*gBatch);
// CPU
int* seqStart = cpuSequence->getData(); int* seqStart = cpuSequence->getData();
float* batchData = cBatch->getData(); float* batchData = cBatch->getData();
float* seqData = cpuInput->getData(); float* seqData = cpuInput->getData();
...@@ -1204,12 +1199,11 @@ void testBatch2seqPadding(int batchSize, int inputDim) { ...@@ -1204,12 +1199,11 @@ void testBatch2seqPadding(int batchSize, int inputDim) {
TensorCheckErr(*cBatch, *cCheck); TensorCheckErr(*cBatch, *cCheck);
} }
TEST(Matrix, warpCTC) { TEST(Matrix, warpCTC) {
for (auto batchSize : {51, 1285, 3884}) { for (auto batchSize : {51, 1285, 3884}) {
for (auto inputDim : {32, 512, 3026}) { for (auto inputDim : {32, 512, 3026}) {
VLOG(3) << " batchSize=" << batchSize << " inputDim=" << inputDim; VLOG(3) << " batchSize=" << batchSize << " inputDim=" << inputDim;
testBatch2seqPadding(batchSize, inputDim); testBatch2seqPadding(batchSize, inputDim);
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册