Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
7b719760
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
Star
20931
Fork
5422
代码
文件
提交
分支
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看板
提交
7b719760
编写于
7月 18, 2018
作者:
L
Luo Tao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into api
上级
e725ae7f
f9f8fbaa
变更
6
展开全部
显示空白变更内容
内联
并排
Showing
6 changed file
with
511 addition
and
17 deletion
+511
-17
paddle/fluid/API.spec
paddle/fluid/API.spec
+438
-0
paddle/fluid/operators/im2sequence_op.cc
paddle/fluid/operators/im2sequence_op.cc
+2
-10
paddle/fluid/operators/im2sequence_op.h
paddle/fluid/operators/im2sequence_op.h
+3
-2
paddle/fluid/operators/sum_mkldnn_op.cc
paddle/fluid/operators/sum_mkldnn_op.cc
+1
-1
paddle/scripts/paddle_build.sh
paddle/scripts/paddle_build.sh
+18
-4
tools/check_pr_approval.py
tools/check_pr_approval.py
+49
-0
未找到文件。
paddle/fluid/API.spec
0 → 100644
浏览文件 @
7b719760
此差异已折叠。
点击以展开。
paddle/fluid/operators/im2sequence_op.cc
浏览文件 @
7b719760
...
...
@@ -33,22 +33,14 @@ class Im2SequenceOp : public framework::OperatorWithKernel {
PADDLE_ENFORCE_EQ
(
in_dim
.
size
(),
4
,
"Input(X) format must be 4D tensor, eg., NCHW."
);
int
batch_size
=
in_dim
[
0
];
int
img_channels
=
in_dim
[
1
];
int
img_height
=
in_dim
[
2
];
int
img_width
=
in_dim
[
3
];
auto
kernels
=
ctx
->
Attrs
().
Get
<
std
::
vector
<
int
>>
(
"kernels"
);
auto
strides
=
ctx
->
Attrs
().
Get
<
std
::
vector
<
int
>>
(
"strides"
);
auto
paddings
=
ctx
->
Attrs
().
Get
<
std
::
vector
<
int
>>
(
"paddings"
);
int
output_height
=
Im2SeqOutputSize
(
img_height
,
kernels
[
0
],
paddings
[
0
],
paddings
[
2
],
strides
[
0
]);
int
output_width
=
Im2SeqOutputSize
(
img_width
,
kernels
[
1
],
paddings
[
1
],
paddings
[
3
],
strides
[
1
]);
ctx
->
SetOutputDim
(
"Out"
,
{
batch_size
*
output_height
*
output_width
,
img_channels
*
kernels
[
0
]
*
kernels
[
1
]});
ctx
->
SetOutputDim
(
"Out"
,
{
in_dim
[
0
],
img_channels
*
kernels
[
0
]
*
kernels
[
1
]});
}
};
...
...
paddle/fluid/operators/im2sequence_op.h
浏览文件 @
7b719760
...
...
@@ -109,12 +109,13 @@ class Im2SequenceKernel : public framework::OpKernel<T> {
}
out
->
set_lod
(
lod
);
}
else
{
out
->
mutable_data
<
T
>
(
ctx
.
GetPlace
());
int
output_height
=
Im2SeqOutputSize
(
img_height
,
kernels
[
0
],
paddings
[
0
],
paddings
[
2
],
strides
[
0
]);
int
output_width
=
Im2SeqOutputSize
(
img_width
,
kernels
[
1
],
paddings
[
1
],
paddings
[
3
],
strides
[
1
]);
out
->
mutable_data
<
T
>
({
batch_size
*
output_height
*
output_width
,
img_channels
*
kernels
[
0
]
*
kernels
[
1
]},
ctx
.
GetPlace
());
const
std
::
vector
<
int
>
dilations
({
1
,
1
});
auto
out_dims
=
out
->
dims
();
out
->
Resize
({
batch_size
,
out
->
numel
()
/
batch_size
});
...
...
paddle/fluid/operators/sum_mkldnn_op.cc
浏览文件 @
7b719760
...
...
@@ -88,7 +88,7 @@ class SumMKLDNNOpKernel : public paddle::framework::OpKernel<T> {
input_format
=
memory
::
format
::
nc
;
}
for
(
int
i
=
in_place
?
1
:
0
;
i
<
N
;
i
++
)
{
for
(
int
i
=
0
;
i
<
N
;
i
++
)
{
PADDLE_ENFORCE
(
in_vars
[
i
]
->
IsType
<
LoDTensor
>
(),
"all inputs must be all LoDTensors"
);
auto
&
input
=
in_vars
[
i
]
->
Get
<
LoDTensor
>
();
...
...
paddle/scripts/paddle_build.sh
浏览文件 @
7b719760
...
...
@@ -19,6 +19,8 @@
# Utils
#=================================================
set
-ex
function
print_usage
()
{
echo
-e
"
\n
${
RED
}
Usage
${
NONE
}
:
${
BOLD
}${
SCRIPT_NAME
}${
NONE
}
[OPTION]"
...
...
@@ -37,6 +39,7 @@ function print_usage() {
${
BLUE
}
fluid_inference_lib
${
NONE
}
: deploy fluid inference library
${
BLUE
}
check_style
${
NONE
}
: run code style check
${
BLUE
}
cicheck
${
NONE
}
: run CI tasks
${
BLUE
}
assert_api_not_changed
${
NONE
}
: check api compability
"
}
...
...
@@ -326,11 +329,23 @@ function assert_api_not_changed() {
virtualenv .env
source
.env/bin/activate
pip
install
${
PADDLE_ROOT
}
/build/python/dist/
*
whl
curl
${
PADDLE_API_SPEC_URL
:-
https
://raw.githubusercontent.com/PaddlePaddle/FluidAPISpec/master/API.spec
}
\
>
origin.spec
python
${
PADDLE_ROOT
}
/tools/print_signatures.py paddle.fluid
>
new.spec
python
${
PADDLE_ROOT
}
/tools/diff_api.py
origin
.spec new.spec
python
${
PADDLE_ROOT
}
/tools/diff_api.py
${
PADDLE_ROOT
}
/paddle/fluid/API
.spec new.spec
deactivate
API_CHANGE
=
`
git diff
--name-only
HEAD^ |
grep
"paddle/fluid/API.spec"
`
echo
"checking API.spec change..."
echo
"
${
GIT_PR_ID
}
,
${
API_CHANGE
}
"
if
[
${
API_CHANGE
}
]
&&
[
"
${
GIT_PR_ID
}
"
!=
""
]
;
then
# TODO: curl -H 'Authorization: token ${TOKEN}'
APPROVALS
=
`
curl
-H
"Authorization: token
${
GITHUB_API_TOKEN
}
"
https://api.github.com/repos/PaddlePaddle/Paddle/pulls/
${
GIT_PR_ID
}
/reviews |
\
python
${
PADDLE_ROOT
}
/tools/check_pr_approval.py 2 7845005 2887803 728699 13348433
`
echo
"current pr
${
GIT_PR_ID
}
got approvals:
${
APPROVALS
}
"
if
[
"
${
APPROVALS
}
"
==
"FALSE"
]
;
then
echo
"You must have at least 2 approvals for the api change!"
exit
1
fi
fi
}
...
...
@@ -537,7 +552,6 @@ EOF
}
function
main
()
{
set
-e
local
CMD
=
$1
init
case
$CMD
in
...
...
tools/check_pr_approval.py
0 → 100644
浏览文件 @
7b719760
# 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.
from
__future__
import
print_function
import
sys
import
json
def
check_approval
(
count
,
required_reviewers
):
json_buff
=
""
for
line
in
sys
.
stdin
:
json_buff
=
""
.
join
([
json_buff
,
line
])
json_resp
=
json
.
loads
(
json_buff
)
approves
=
0
approved_user_ids
=
[]
for
review
in
json_resp
:
if
review
[
"state"
]
==
"APPROVED"
:
approves
+=
1
approved_user_ids
.
append
(
review
[
"user"
][
"id"
])
# convert to int
required_reviewers_int
=
set
()
for
rr
in
required_reviewers
:
required_reviewers_int
.
add
(
int
(
rr
))
if
len
(
set
(
approved_user_ids
)
&
required_reviewers_int
)
>=
count
:
print
(
"TRUE"
)
else
:
print
(
"FALSE"
)
if
__name__
==
"__main__"
:
if
len
(
sys
.
argv
)
>
1
and
sys
.
argv
[
1
].
isdigit
():
check_approval
(
int
(
sys
.
argv
[
1
]),
sys
.
argv
[
2
:])
else
:
print
(
"Usage: python check_pr_approval.py [count] [required reviewer id] ..."
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录