Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wzpei9
Paddle
提交
3b96aa08
P
Paddle
项目概览
wzpei9
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3b96aa08
编写于
3月 04, 2019
作者:
C
ceci3
浏览文件
操作
浏览文件
下载
差异文件
conflict fix
上级
06d8e1a1
e2da3a5b
变更
5
展开全部
显示空白变更内容
内联
并排
Showing
5 changed file
with
525 addition
and
604 deletion
+525
-604
paddle/fluid/API.spec
paddle/fluid/API.spec
+500
-500
paddle/scripts/paddle_build.sh
paddle/scripts/paddle_build.sh
+14
-17
python/paddle/fluid/layers/nn.py
python/paddle/fluid/layers/nn.py
+0
-1
tools/check_doc_approval.py
tools/check_doc_approval.py
+0
-85
tools/print_signatures.py
tools/print_signatures.py
+11
-1
未找到文件。
paddle/fluid/API.spec
浏览文件 @
3b96aa08
此差异已折叠。
点击以展开。
paddle/scripts/paddle_build.sh
浏览文件 @
3b96aa08
...
...
@@ -415,10 +415,11 @@ function assert_api_not_changed() {
source
.env/bin/activate
pip
install
${
PADDLE_ROOT
}
/build/python/dist/
*
whl
python
${
PADDLE_ROOT
}
/tools/print_signatures.py paddle.fluid,paddle.reader
>
new.spec
if
[
"
$1
"
==
"cp35-cp35m"
]
||
[
"
$1
"
==
"cp36-cp36m"
]
||
[
"
$1
"
==
"cp37-cp37m"
]
;
then
# Use sed to make python2 and python3 sepc keeps the same
sed
-i
's/arg0: str/arg0: unicode/g'
new.spec
sed
-i
"s/
\(
.*Transpiler.*
\)
.__init__ ArgSpec(args=
\[
'self'].*/
\1
.__init__ /g"
new.spec
sed
-i
"s/
\(
.*Transpiler.*
\)
.__init__
(
ArgSpec(args=
\[
'self'].*/
\1
.__init__ /g"
new.spec
fi
# ComposeNotAligned has significant difference between py2 and py3
sed
-i
'/.*ComposeNotAligned.*/d'
new.spec
...
...
@@ -452,11 +453,20 @@ function assert_api_spec_approvals() {
echo
"checking
${
API_FILE
}
change, PR:
${
GIT_PR_ID
}
, changes:
${
API_CHANGE
}
"
if
[
${
API_CHANGE
}
]
&&
[
"
${
GIT_PR_ID
}
"
!=
""
]
;
then
# NOTE: per_page=10000 should be ok for all cases, a PR review > 10000 is not human readable.
if
[
"
$API_FILE
"
==
"paddle/fluid/API.spec"
]
;
then
APPROVALS
=
`
curl
-H
"Authorization: token
${
GITHUB_API_TOKEN
}
"
https://api.github.com/repos/PaddlePaddle/Paddle/pulls/
${
GIT_PR_ID
}
/reviews?per_page
=
10000 |
\
python
${
PADDLE_ROOT
}
/tools/check_pr_approval.py 2 2887803 35982308
`
else
APPROVALS
=
`
curl
-H
"Authorization: token
${
GITHUB_API_TOKEN
}
"
https://api.github.com/repos/PaddlePaddle/Paddle/pulls/
${
GIT_PR_ID
}
/reviews?per_page
=
10000 |
\
python
${
PADDLE_ROOT
}
/tools/check_pr_approval.py 1 2887803
`
fi
echo
"current pr
${
GIT_PR_ID
}
got approvals:
${
APPROVALS
}
"
if
[
"
${
APPROVALS
}
"
==
"FALSE"
]
;
then
if
[
"
$API_FILE
"
==
"paddle/fluid/API.spec"
]
;
then
echo
"You must have panyx0718 and shanyi15 approval for the api change!
${
API_FILE
}
"
else
echo
"You must have panyx0718 approval for the api change!
${
API_FILE
}
"
fi
exit
1
fi
fi
...
...
@@ -472,19 +482,6 @@ function assert_api_spec_approvals() {
exit
1
fi
fi
pip
install
${
PADDLE_ROOT
}
/build/opt/paddle/share/wheels/
*
.whl
CHECK_DOCK_MD5
=
`
python
${
PADDLE_ROOT
}
/tools/check_doc_approval.py
`
if
[
"True"
!=
${
CHECK_DOCK_MD5
}
]
;
then
APPROVALS
=
`
curl
-H
"Authorization: token
${
GITHUB_API_TOKEN
}
"
https://api.github.com/repos/PaddlePaddle/Paddle/pulls/
${
GIT_PR_ID
}
/reviews?per_page
=
10000 |
\
python
${
PADDLE_ROOT
}
/tools/check_pr_approval.py 1 35982308
`
echo
"current pr
${
GIT_PR_ID
}
got approvals:
${
APPROVALS
}
"
if
[
"
${
APPROVALS
}
"
==
"FALSE"
]
;
then
echo
"You must have shanyi15 approval for the api doc change! "
exit
1
fi
echo
${
CHECK_DOCK_MD5
}
>
/root/.cache/doc_md5.txt
fi
}
...
...
python/paddle/fluid/layers/nn.py
浏览文件 @
3b96aa08
...
...
@@ -6889,7 +6889,6 @@ def image_resize(input,
H_out = (H_{in}+0.5) * scale_{factor} - 0.5
W_out = (W_{in}+0.5) * scale_{factor} - 0.5
else:
input : (N,C,H_in,W_in)
...
...
tools/check_doc_approval.py
已删除
100644 → 0
浏览文件 @
06d8e1a1
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
os
import
sys
import
ast
import
hashlib
import
importlib
import
paddle.fluid
files
=
[
"paddle.fluid"
,
"paddle.fluid.average"
,
"paddle.fluid.backward"
,
"paddle.fluid.clip"
,
"paddle.fluid.data_feeder"
,
"paddle.fluid.executor"
,
"paddle.fluid.initializer"
,
"paddle.fluid.io"
,
"paddle.fluid.layers"
,
"paddle.fluid.metrics"
,
"paddle.fluid.nets"
,
"paddle.fluid.optimizer"
,
"paddle.fluid.profiler"
,
"paddle.fluid.recordio_writer"
,
"paddle.fluid.regularizer"
,
"paddle.fluid.transpiler"
]
def
md5
(
doc
):
hash
=
hashlib
.
md5
()
hash
.
update
(
str
(
doc
))
return
hash
.
hexdigest
()
def
get_module
():
for
fi
in
files
:
fi_lib
=
importlib
.
import_module
(
fi
)
doc_function
=
getattr
(
fi_lib
,
"__all__"
)
for
api
in
doc_function
:
api_name
=
fi
+
"."
+
api
try
:
doc_module
=
getattr
(
eval
(
api_name
),
"__doc__"
)
except
:
pass
doc_md5_code
=
md5
(
doc_module
)
doc_dict
[
api_name
]
=
doc_md5_code
def
doc_md5_dict
(
doc_md5_path
):
with
open
(
doc_md5_path
,
"rb"
)
as
f
:
doc_md5
=
f
.
read
()
doc_md5_dict
=
ast
.
literal_eval
(
doc_md5
)
return
doc_md5_dict
def
check_doc_md5
():
for
k
,
v
in
doc_dict
.
items
():
try
:
if
doc_ci_dict
[
k
]
!=
v
:
return
doc_dict
except
:
return
doc_dict
return
True
if
__name__
==
"__main__"
:
doc_dict
=
{}
doc_ci_dict
=
{}
doc_md5_file
=
"/root/.cache/doc_md5.txt"
if
not
os
.
path
.
exists
(
doc_md5_file
):
os
.
mknod
(
doc_md5_file
)
else
:
doc_ci_dict
=
doc_md5_dict
(
doc_md5_file
)
get_module
()
if
not
os
.
path
.
getsize
(
doc_md5_file
):
with
open
(
doc_md5_file
,
'w'
)
as
f
:
f
.
write
(
str
(
doc_dict
))
check_dic
=
True
print
(
check_dic
)
else
:
check_dic
=
check_doc_md5
()
print
(
check_dic
)
tools/print_signatures.py
浏览文件 @
3b96aa08
...
...
@@ -24,12 +24,19 @@ import inspect
import
collections
import
sys
import
pydoc
import
hashlib
member_dict
=
collections
.
OrderedDict
()
experimental_namespace
=
{
"paddle.fluid.imperative"
}
def
md5
(
doc
):
hash
=
hashlib
.
md5
()
hash
.
update
(
str
(
doc
).
encode
(
'utf-8'
))
return
hash
.
hexdigest
()
def
visit_member
(
parent_name
,
member
):
cur_name
=
"."
.
join
([
parent_name
,
member
.
__name__
])
if
inspect
.
isclass
(
member
):
...
...
@@ -39,7 +46,10 @@ def visit_member(parent_name, member):
visit_member
(
cur_name
,
value
)
elif
callable
(
member
):
try
:
member_dict
[
cur_name
]
=
inspect
.
getargspec
(
member
)
doc
=
(
'document'
,
md5
(
member
.
__doc__
))
args
=
inspect
.
getargspec
(
member
)
all
=
(
args
,
doc
)
member_dict
[
cur_name
]
=
all
except
TypeError
:
# special for PyBind method
member_dict
[
cur_name
]
=
" "
.
join
([
line
.
strip
()
for
line
in
pydoc
.
render_doc
(
member
).
split
(
'
\n
'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录