From 11479901a7e0b53a3e7ea3cc07a47dbf9e1c5ce6 Mon Sep 17 00:00:00 2001 From: hedaoyuan Date: Thu, 1 Dec 2016 21:54:19 +0800 Subject: [PATCH] some bug fix --- paddle/math/tests/TestUtils.h | 5 +++++ paddle/math/tests/test_matrixCompare.cpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/paddle/math/tests/TestUtils.h b/paddle/math/tests/TestUtils.h index ffcb71044e..2edb07de01 100644 --- a/paddle/math/tests/TestUtils.h +++ b/paddle/math/tests/TestUtils.h @@ -93,6 +93,11 @@ float construct(int height, int width) { return 0.5; } +template <> +double construct(int height, int width) { + return 0.5; +} + template <> size_t construct(int height, int width) { size_t offset = std::rand() % (height < width ? height : width); diff --git a/paddle/math/tests/test_matrixCompare.cpp b/paddle/math/tests/test_matrixCompare.cpp index 0e9ca16141..0883066947 100644 --- a/paddle/math/tests/test_matrixCompare.cpp +++ b/paddle/math/tests/test_matrixCompare.cpp @@ -290,8 +290,8 @@ void testMatrixDeepSwap(int height, int width) { // swap matrix cpuA and cpuB cpuA->deepSwap(*cpuB); - MatrixCheckEqual(*cpuA, *cpuCopyB); - MatrixCheckEqual(*cpuB, *cpuCopyA); + TensorCheckEqual(*cpuA, *cpuCopyB); + TensorCheckEqual(*cpuB, *cpuCopyA); } void testMatrixTranspose(int height, int width) { -- GitLab