提交 6b058ea0 编写于 作者: T Tao Luo 提交者: GitHub

Merge pull request #1824 from hedaoyuan/fix_1769

Fix ContextProjectionOpTest
......@@ -28,11 +28,12 @@ void testMatrixProjectionForward(int context_start,
std::max(0, (int)(context_start + context_length - 1));
if (pad == 0) is_padding = false;
FunctionCompare test("ContextProjectionForward",
FunctionCompare test(
"ContextProjectionForward",
FuncConfig()
.set("context_length", context_length)
.set("context_start", context_start)
.set("begin_pad", std::max(0, -context_start)));
.set("begin_pad", (size_t)std::max(0, -context_start)));
// prepare input arguments
test.addSequence(SequenceIdArg(TensorShape{batch_size}));
......@@ -51,7 +52,7 @@ void testMatrixProjectionForward(int context_start,
}
void testMatrixProjectionBackward(int context_start,
int context_length,
size_t context_length,
bool is_padding,
size_t batch_size,
size_t input_dim) {
......@@ -59,11 +60,12 @@ void testMatrixProjectionBackward(int context_start,
std::max(0, (int)(context_start + context_length - 1));
if (pad == 0) is_padding = false;
FunctionCompare test("ContextProjectionBackward",
FunctionCompare test(
"ContextProjectionBackward",
FuncConfig()
.set("context_length", context_length)
.set("context_start", context_start)
.set("begin_pad", std::max(0, -context_start))
.set("begin_pad", (size_t)std::max(0, -context_start))
.set("is_padding", is_padding)
.set("total_pad", pad));
......
......@@ -235,8 +235,10 @@ TEST(Matrix, unary) {
testMatrixTranspose(height, width);
testMatrixRotate(height, width);
}
// inverse
// inverse
#ifdef PADDLE_USE_LAPACK
testMatrixInverse(height);
#endif
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册