Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
82f8304f
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 2 年 前同步成功
通知
2325
Star
20933
Fork
5424
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
82f8304f
编写于
8月 04, 2017
作者:
Y
Yu Yang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'feature/fast_python_unittest' into feature/change_op_creation
上级
a239418b
36d40b1b
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
50 addition
and
56 deletion
+50
-56
CMakeLists.txt
CMakeLists.txt
+1
-0
cmake/external/python.cmake
cmake/external/python.cmake
+0
-1
cmake/util.cmake
cmake/util.cmake
+15
-5
paddle/.set_python_path.sh
paddle/.set_python_path.sh
+12
-19
paddle/scripts/docker/build.sh
paddle/scripts/docker/build.sh
+12
-14
paddle/scripts/run_python_tests.sh
paddle/scripts/run_python_tests.sh
+8
-15
paddle/setup.py.in
paddle/setup.py.in
+1
-1
python/setup.py.in
python/setup.py.in
+1
-1
未找到文件。
CMakeLists.txt
浏览文件 @
82f8304f
...
@@ -55,6 +55,7 @@ option(WITH_C_API "Compile PaddlePaddle with C-API(Prediction)" OFF)
...
@@ -55,6 +55,7 @@ option(WITH_C_API "Compile PaddlePaddle with C-API(Prediction)" OFF)
option
(
WITH_GOLANG
"Compile PaddlePaddle with GOLANG"
OFF
)
option
(
WITH_GOLANG
"Compile PaddlePaddle with GOLANG"
OFF
)
option
(
GLIDE_INSTALL
"Download and install go dependencies "
ON
)
option
(
GLIDE_INSTALL
"Download and install go dependencies "
ON
)
option
(
USE_NNPACK
"Compile PaddlePaddle with NNPACK library"
OFF
)
option
(
USE_NNPACK
"Compile PaddlePaddle with NNPACK library"
OFF
)
option
(
UNITTEST_USE_VIRTUALENV
"Python unittest with virtualenv"
ON
)
# CMAKE_BUILD_TYPE
# CMAKE_BUILD_TYPE
if
(
NOT CMAKE_BUILD_TYPE
)
if
(
NOT CMAKE_BUILD_TYPE
)
...
...
cmake/external/python.cmake
浏览文件 @
82f8304f
...
@@ -24,7 +24,6 @@ IF(WITH_PYTHON)
...
@@ -24,7 +24,6 @@ IF(WITH_PYTHON)
ENDIF
(
WITH_PYTHON
)
ENDIF
(
WITH_PYTHON
)
SET
(
py_env
""
)
SET
(
py_env
""
)
SET
(
USE_VIRTUALENV_FOR_TEST 1
)
IF
(
PYTHONINTERP_FOUND
)
IF
(
PYTHONINTERP_FOUND
)
find_python_module
(
pip REQUIRED
)
find_python_module
(
pip REQUIRED
)
find_python_module
(
numpy REQUIRED
)
find_python_module
(
numpy REQUIRED
)
...
...
cmake/util.cmake
浏览文件 @
82f8304f
...
@@ -150,9 +150,19 @@ endfunction()
...
@@ -150,9 +150,19 @@ endfunction()
# Create a python unittest using run_python_tests.sh,
# Create a python unittest using run_python_tests.sh,
# which takes care of making correct running environment
# which takes care of making correct running environment
function
(
add_python_test TEST_NAME
)
function
(
add_python_test TEST_NAME
)
add_test
(
NAME
${
TEST_NAME
}
if
(
UNITTEST_USE_VIRTUALENV
)
COMMAND env PADDLE_PACKAGE_DIR=
${
PADDLE_PYTHON_PACKAGE_DIR
}
add_test
(
NAME
${
TEST_NAME
}
bash
${
PROJ_ROOT
}
/paddle/scripts/run_python_tests.sh
COMMAND env PADDLE_PACKAGE_DIR=
${
PADDLE_PYTHON_PACKAGE_DIR
}
${
USE_VIRTUALENV_FOR_TEST
}
${
PYTHON_EXECUTABLE
}
${
ARGN
}
bash
${
PROJ_ROOT
}
/paddle/scripts/run_python_tests.sh
${
ARGN
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
else
()
foreach
(
arg
${
ARGN
}
)
get_filename_component
(
py_fn
${
arg
}
NAME_WE
)
set
(
TRG_NAME
${
TEST_NAME
}
_
${
py_fn
}
)
add_test
(
NAME
${
TRG_NAME
}
COMMAND env PYTHONPATH=
${
PADDLE_PYTHON_PACKAGE_DIR
}
python2
${
arg
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_SOURCE_DIR
}
)
endforeach
()
endif
()
endfunction
()
endfunction
()
paddle/.set_python_path.sh
浏览文件 @
82f8304f
...
@@ -21,22 +21,15 @@
...
@@ -21,22 +21,15 @@
#
#
# It same as PYTHONPATH=${YOUR_PYTHON_PATH}:$PYTHONPATH {exec...}
# It same as PYTHONPATH=${YOUR_PYTHON_PATH}:$PYTHONPATH {exec...}
#
#
PYPATH
=
""
if
!
python
-c
"import paddle"
>
/dev/null 2>/dev/null
;
then
set
-x
PYPATH
=
""
while
getopts
"d:"
opt
;
do
set
-x
case
$opt
in
while
getopts
"d:"
opt
;
do
d
)
case
$opt
in
PYPATH
=
$OPTARG
d
)
;;
PYPATH
=
$OPTARG
esac
;;
done
esac
shift
$((
$OPTIND
-
1
))
done
export
PYTHONPATH
=
$PYPATH
:
$PYTHONPATH
shift
$((
$OPTIND
-
1
))
$@
export
PYTHONPATH
=
$PYPATH
:
$PYTHONPATH
$@
else
echo
"paddle package is already in your PYTHONPATH. But unittest need a clean environment."
echo
"Please uninstall paddle package before start unittest. Try to 'pip uninstall paddle'"
exit
1
fi
paddle/scripts/docker/build.sh
浏览文件 @
82f8304f
...
@@ -49,29 +49,27 @@ cmake .. \
...
@@ -49,29 +49,27 @@ cmake .. \
-DCUDNN_ROOT
=
/usr/
\
-DCUDNN_ROOT
=
/usr/
\
-DWITH_STYLE_CHECK
=
${
WITH_STYLE_CHECK
:-
OFF
}
\
-DWITH_STYLE_CHECK
=
${
WITH_STYLE_CHECK
:-
OFF
}
\
-DWITH_TESTING
=
${
WITH_TESTING
:-
OFF
}
\
-DWITH_TESTING
=
${
WITH_TESTING
:-
OFF
}
\
-DCMAKE_EXPORT_COMPILE_COMMANDS
=
ON
-DCMAKE_EXPORT_COMPILE_COMMANDS
=
ON
\
-DUNITTEST_USE_VIRTUALENV
=
OFF
cat
<<
EOF
cat
<<
EOF
========================================
========================================
====
Building in /paddle/build ...
Building
and installing
in /paddle/build ...
Build unit tests:
${
WITH_TESTING
:-
OFF
}
Build unit tests:
${
WITH_TESTING
:-
OFF
}
========================================
========================================
====
EOF
EOF
make
-j
`
nproc
`
make
install
-j
`
nproc
`
if
[
${
WITH_TESTING
:-
OFF
}
==
"ON"
]
&&
[
${
RUN_TEST
:-
OFF
}
==
"ON"
]
;
then
pip
install
/usr/local/opt/paddle/share/wheels/
*
.whl
pip uninstall
-y
py-paddle paddle
||
true
paddle version
ctest
--output-on-failure
fi
if
[
${
WITH_TESTING
:-
OFF
}
==
"ON"
]
&&
[
${
RUN_TEST
:-
OFF
}
==
"ON"
]
;
then
cat
<<
EOF
cat
<<
EOF
========================================
========================================
Installing
...
Running unit tests
...
========================================
========================================
EOF
EOF
make
install
-j
`
nproc
`
ctest
--output-on-failure
pip
install
/usr/local/opt/paddle/share/wheels/
*
.whl
fi
paddle version
# To build documentation, we need to run cmake again after installing
# To build documentation, we need to run cmake again after installing
...
...
paddle/scripts/run_python_tests.sh
浏览文件 @
82f8304f
...
@@ -18,17 +18,12 @@ pushd `dirname $0` > /dev/null
...
@@ -18,17 +18,12 @@ pushd `dirname $0` > /dev/null
SCRIPTPATH
=
$PWD
SCRIPTPATH
=
$PWD
popd
>
/dev/null
popd
>
/dev/null
USE_VIRTUALENV_FOR_TEST
=
$1
;
shift
rm
-rf
.test_env
PYTHON
=
$1
;
shift
virtualenv .test_env
unset
PYTHONHOME
if
[
$USE_VIRTUALENV_FOR_TEST
-ne
0
]
;
then
unset
PYTHONPATH
rm
-rf
.test_env
source
.test_env/bin/activate
virtualenv .test_env
PYTHON
=
python
unset
PYTHONHOME
unset
PYTHONPATH
source
.test_env/bin/activate
PYTHON
=
python
fi
$PYTHON
-m
pip
install
$SCRIPTPATH
/../dist/
*
.whl
$PYTHON
-m
pip
install
$SCRIPTPATH
/../dist/
*
.whl
...
@@ -49,7 +44,5 @@ do
...
@@ -49,7 +44,5 @@ do
fi
fi
done
done
if
[
$USE_VIRTUALENV_FOR_TEST
-ne
0
]
;
then
deactivate
deactivate
rm
-rf
.test_env
rm
-rf
.test_env
fi
paddle/setup.py.in
浏览文件 @
82f8304f
...
@@ -22,7 +22,7 @@ setup(name="py_paddle",
...
@@ -22,7 +22,7 @@ setup(name="py_paddle",
package_data={'py_paddle':['*.py','_swig_paddle.so']},
package_data={'py_paddle':['*.py','_swig_paddle.so']},
install_requires = [
install_requires = [
'nltk>=3.2.2',
'nltk>=3.2.2',
'numpy>=1.
8
.0', # The numpy is required.
'numpy>=1.
12
.0', # The numpy is required.
'protobuf==${PROTOBUF_VERSION}' # The paddle protobuf version
'protobuf==${PROTOBUF_VERSION}' # The paddle protobuf version
],
],
url='http://www.paddlepaddle.org/',
url='http://www.paddlepaddle.org/',
...
...
python/setup.py.in
浏览文件 @
82f8304f
...
@@ -14,7 +14,7 @@ packages=['paddle',
...
@@ -14,7 +14,7 @@ packages=['paddle',
'paddle.v2.framework.proto']
'paddle.v2.framework.proto']
setup_requires=["requests",
setup_requires=["requests",
"numpy",
"numpy
>=1.12
",
"protobuf==3.1",
"protobuf==3.1",
"recordio",
"recordio",
"matplotlib",
"matplotlib",
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录