提交 2368377a 编写于 作者: H hedaoyuan

Bug fix.

上级 6a14f52d
......@@ -3,8 +3,10 @@
add_simple_unittest(test_ExecViaCpu)
add_simple_unittest(test_SIMDFunctions)
add_simple_unittest(test_TrainingAlgorithm)
add_simple_unittest(test_SparseMatrix)
add_simple_unittest(test_RowBuffer)
if(NOT MOBILE_INFERENCE)
add_simple_unittest(test_SparseMatrix)
endif()
# TODO(yuyang18): Refactor TestUtil.cpp. Remove this cross module reference.
add_unittest(test_matrixCompare
......
......@@ -200,7 +200,9 @@ void Parameter::setMat(ParameterType pType, int matType) {
false,
useGpu_);
}
} else if (matType == MAT_NORMAL_SHARED) {
}
#ifndef PADDLE_MOBILE_INFERENCE
else if (matType == MAT_NORMAL_SHARED) {
CHECK_EQ(height * width, bufs_[pType]->getSize());
size_t blockNum = 0;
CHECK(isGradShared(&blockNum));
......@@ -217,9 +219,7 @@ void Parameter::setMat(ParameterType pType, int matType) {
bufs_[pType]->getMemoryHandle()),
height,
width);
}
#ifndef PADDLE_MOBILE_INFERENCE
else if (matType == MAT_SPARSE_ROW_IDS) {
} else if (matType == MAT_SPARSE_ROW_IDS) {
CHECK_EQ(height * width, bufs_[pType]->getSize());
mats_[pType] = std::make_shared<SparseRowIdsCpuMatrix>(
std::dynamic_pointer_cast<CpuMemoryHandle>(
......
......@@ -33,6 +33,7 @@ MatrixPtr makeRandomSparseMatrix(size_t height,
bool withValue,
bool useGpu,
bool equalNnzPerSample) {
#ifndef PADDLE_MOBILE_INFERENCE
std::vector<int64_t> ids(height);
std::vector<int64_t> indices(height + 1);
indices[0] = 0;
......@@ -84,6 +85,8 @@ MatrixPtr makeRandomSparseMatrix(size_t height,
}
return mat;
}
#endif
return nullptr;
}
void generateSequenceStartPositions(size_t batchSize,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册