From 7bb7fed8336232321bcb8dfff002c224ae746cf2 Mon Sep 17 00:00:00 2001 From: Liu Yiqun Date: Fri, 2 Dec 2016 09:22:51 +0000 Subject: [PATCH] Simplify the CMakelist.txt and fix typos. --- CMakeLists.txt | 13 ++++--------- paddle/scripts/travis/build_and_test.sh | 2 +- .../travis/{submodules.sh => build_submodules.sh} | 2 ++ python/paddle/trainer_config_helpers/layers.py | 12 ++++++------ 4 files changed, 13 insertions(+), 16 deletions(-) rename paddle/scripts/travis/{submodules.sh => build_submodules.sh} (93%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 28375d0cd06..dfb5159ea12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,15 +77,10 @@ find_package(Git REQUIRED) include(version) add_definitions(-DPADDLE_VERSION=\"${PADDLE_VERSION}\") - if(NOT WITH_GPU) add_definitions(-DPADDLE_ONLY_CPU) add_definitions(-DHPPL_STUB_FUNC) - if(WITH_DSO) - add_definitions(-DPADDLE_USE_DSO) - endif(WITH_DSO) - list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS cu) else() if(${CUDA_VERSION_MAJOR} GREATER 6) @@ -107,15 +102,15 @@ else() set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler ${SSE3_FLAG}") endif(WITH_AVX) - if(WITH_DSO) - add_definitions(-DPADDLE_USE_DSO) - endif(WITH_DSO) - # Include cuda and cudnn include_directories(${CUDNN_INCLUDE_DIR}) include_directories(${CUDA_TOOLKIT_INCLUDE}) endif(NOT WITH_GPU) +if(WITH_DSO) + add_definitions(-DPADDLE_USE_DSO) +endif(WITH_DSO) + if(WITH_DOUBLE) add_definitions(-DPADDLE_TYPE_DOUBLE) set(ACCURACY double) diff --git a/paddle/scripts/travis/build_and_test.sh b/paddle/scripts/travis/build_and_test.sh index c46c119daeb..9caeb21beb1 100755 --- a/paddle/scripts/travis/build_and_test.sh +++ b/paddle/scripts/travis/build_and_test.sh @@ -1,5 +1,5 @@ #!/bin/bash -./submodules.sh +./build_submodules.sh source ./common.sh CMAKE_EXTRA="" if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then diff --git a/paddle/scripts/travis/submodules.sh b/paddle/scripts/travis/build_submodules.sh similarity index 93% rename from paddle/scripts/travis/submodules.sh rename to paddle/scripts/travis/build_submodules.sh index 47bd8d87ac6..d458bf92bf4 100755 --- a/paddle/scripts/travis/submodules.sh +++ b/paddle/scripts/travis/build_submodules.sh @@ -1,5 +1,6 @@ #!/bin/bash set -e +WORK_DIR=$PWD PROJ_ROOT=$(git rev-parse --show-cdup) SUBMODULES=$(grep path ${PROJ_ROOT}.gitmodules | sed 's/^.*path = //') @@ -16,3 +17,4 @@ do ;; esac done +cd $WORK_DIR diff --git a/python/paddle/trainer_config_helpers/layers.py b/python/paddle/trainer_config_helpers/layers.py index bf043c3674b..bec675a8cea 100644 --- a/python/paddle/trainer_config_helpers/layers.py +++ b/python/paddle/trainer_config_helpers/layers.py @@ -1874,7 +1874,7 @@ def img_conv_layer(input, param_attr.attr["initial_std"] = init_w param_attr.attr["initial_strategy"] = 0 param_attr.attr["initial_smart"] = False - + if layer_type: if trans: assert layer_type in ["exconvt"] @@ -4125,11 +4125,11 @@ def warp_ctc_layer(input, Note: - Let num_classes represent the category number. Considering the 'blank' - label needed by CTC, you need to use (num_classes + 1) as the input size. - Thus, the size of both warp_ctc_layer and 'input' layer should be set to - num_classes + 1. - - You can set 'blank' to [0, num_classes - 1], which should be consistent - as that used in your labels. + label needed by CTC, you need to use (num_classes + 1) as the input + size. Thus, the size of both warp_ctc_layer and 'input' layer should + be set to num_classes + 1. + - You can set 'blank' to any value ranged in [0, num_classes], which + should be consistent as that used in your labels. - As a native 'softmax' activation is interated to the warp-ctc library, 'linear' activation is expected instead in the 'input' layer. -- GitLab