提交 d2e94346 编写于 作者: Q qingqing01 提交者: GitHub

Merge pull request #3361 from qingqing01/kmax_seq_test

fix test_KmaxSeqScore for only CPU compile.
...@@ -96,6 +96,11 @@ TEST(Layer, kmaxSeqScoreLayer) { ...@@ -96,6 +96,11 @@ TEST(Layer, kmaxSeqScoreLayer) {
MatrixPtr inValue = MatrixPtr inValue =
Matrix::create(subSeqStartPosition.back(), 1, false, false); Matrix::create(subSeqStartPosition.back(), 1, false, false);
std::vector<bool> mode = {false};
#ifndef PADDLE_ONLY_CPU
mode.push_back(true);
#endif
for (auto hasSubseq : {false, true}) { for (auto hasSubseq : {false, true}) {
vector<vector<int>> groundTruth; vector<vector<int>> groundTruth;
inValue->randomizeUniform(); inValue->randomizeUniform();
...@@ -104,7 +109,7 @@ TEST(Layer, kmaxSeqScoreLayer) { ...@@ -104,7 +109,7 @@ TEST(Layer, kmaxSeqScoreLayer) {
hasSubseq ? subSeqStartPosition : seqStartPosition, hasSubseq ? subSeqStartPosition : seqStartPosition,
beamSize); beamSize);
for (auto useGpu : {false, true}) { for (auto useGpu : mode) {
TestConfig config; TestConfig config;
config.layerConfig.set_type("kmax_seq_score"); config.layerConfig.set_type("kmax_seq_score");
config.layerConfig.set_beam_size(beamSize); config.layerConfig.set_beam_size(beamSize);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册