提交 32a540d2 编写于 作者: Q qijun

Merge branch 'master' into feature/fix_with_doc_build_option

...@@ -13,7 +13,7 @@ ARG WITH_DOC ...@@ -13,7 +13,7 @@ ARG WITH_DOC
ARG WITH_STYLE_CHECK ARG WITH_STYLE_CHECK
ENV WOBOQ OFF ENV WOBOQ OFF
ENV WITH_GPU=${WITH_AVX:-OFF} ENV WITH_GPU=${WITH_GPU:-OFF}
ENV WITH_AVX=${WITH_AVX:-ON} ENV WITH_AVX=${WITH_AVX:-ON}
ENV WITH_DOC=${WITH_DOC:-OFF} ENV WITH_DOC=${WITH_DOC:-OFF}
ENV WITH_STYLE_CHECK=${WITH_STYLE_CHECK:-OFF} ENV WITH_STYLE_CHECK=${WITH_STYLE_CHECK:-OFF}
......
...@@ -28,6 +28,11 @@ ELSE(WIN32) ...@@ -28,6 +28,11 @@ ELSE(WIN32)
STRING(REGEX MATCH "[0-9]+.[0-9]+" VERSION "${MACOSX_VERSION}") STRING(REGEX MATCH "[0-9]+.[0-9]+" VERSION "${MACOSX_VERSION}")
SET(MACOS_VERSION ${VERSION}) SET(MACOS_VERSION ${VERSION})
SET(HOST_SYSTEM "macosx") SET(HOST_SYSTEM "macosx")
IF(NOT DEFINED ENV{MACOSX_DEPLOYMENT_TARGET})
# Set cache variable - end user may change this during ccmake or cmake-gui configure.
SET(CMAKE_OSX_DEPLOYMENT_TARGET ${MACOS_VERSION} CACHE STRING
"Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
ENDIF()
ELSE(APPLE) ELSE(APPLE)
IF(EXISTS "/etc/issue") IF(EXISTS "/etc/issue")
......
...@@ -28,11 +28,12 @@ void testMatrixProjectionForward(int context_start, ...@@ -28,11 +28,12 @@ void testMatrixProjectionForward(int context_start,
std::max(0, (int)(context_start + context_length - 1)); std::max(0, (int)(context_start + context_length - 1));
if (pad == 0) is_padding = false; if (pad == 0) is_padding = false;
FunctionCompare test("ContextProjectionForward", FunctionCompare test(
FuncConfig() "ContextProjectionForward",
.set("context_length", context_length) FuncConfig()
.set("context_start", context_start) .set("context_length", context_length)
.set("begin_pad", std::max(0, -context_start))); .set("context_start", context_start)
.set("begin_pad", (size_t)std::max(0, -context_start)));
// prepare input arguments // prepare input arguments
test.addSequence(SequenceIdArg(TensorShape{batch_size})); test.addSequence(SequenceIdArg(TensorShape{batch_size}));
...@@ -51,7 +52,7 @@ void testMatrixProjectionForward(int context_start, ...@@ -51,7 +52,7 @@ void testMatrixProjectionForward(int context_start,
} }
void testMatrixProjectionBackward(int context_start, void testMatrixProjectionBackward(int context_start,
int context_length, size_t context_length,
bool is_padding, bool is_padding,
size_t batch_size, size_t batch_size,
size_t input_dim) { size_t input_dim) {
...@@ -59,13 +60,14 @@ void testMatrixProjectionBackward(int context_start, ...@@ -59,13 +60,14 @@ void testMatrixProjectionBackward(int context_start,
std::max(0, (int)(context_start + context_length - 1)); std::max(0, (int)(context_start + context_length - 1));
if (pad == 0) is_padding = false; if (pad == 0) is_padding = false;
FunctionCompare test("ContextProjectionBackward", FunctionCompare test(
FuncConfig() "ContextProjectionBackward",
.set("context_length", context_length) FuncConfig()
.set("context_start", context_start) .set("context_length", context_length)
.set("begin_pad", std::max(0, -context_start)) .set("context_start", context_start)
.set("is_padding", is_padding) .set("begin_pad", (size_t)std::max(0, -context_start))
.set("total_pad", pad)); .set("is_padding", is_padding)
.set("total_pad", pad));
// prepare input arguments // prepare input arguments
test.addSequence(SequenceIdArg(TensorShape{batch_size})); test.addSequence(SequenceIdArg(TensorShape{batch_size}));
......
...@@ -235,8 +235,10 @@ TEST(Matrix, unary) { ...@@ -235,8 +235,10 @@ TEST(Matrix, unary) {
testMatrixTranspose(height, width); testMatrixTranspose(height, width);
testMatrixRotate(height, width); testMatrixRotate(height, width);
} }
// inverse // inverse
#ifdef PADDLE_USE_LAPACK
testMatrixInverse(height); testMatrixInverse(height);
#endif
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册