Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
e0f7bf4f
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e0f7bf4f
编写于
4月 15, 2019
作者:
T
tink2123
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
polish the code
test=develop
上级
ffe81af0
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
12 addition
and
23 deletion
+12
-23
paddle/fluid/operators/affine_channel_op.cc
paddle/fluid/operators/affine_channel_op.cc
+3
-6
paddle/fluid/operators/conv_op.cc
paddle/fluid/operators/conv_op.cc
+1
-1
paddle/fluid/operators/roi_pool_op.cc
paddle/fluid/operators/roi_pool_op.cc
+6
-8
paddle/fluid/operators/row_conv_op.cc
paddle/fluid/operators/row_conv_op.cc
+1
-7
paddle/fluid/operators/unpool_op.cc
paddle/fluid/operators/unpool_op.cc
+1
-1
未找到文件。
paddle/fluid/operators/affine_channel_op.cc
浏览文件 @
e0f7bf4f
...
@@ -80,14 +80,11 @@ class AffineChannelOp : public framework::OperatorWithKernel {
...
@@ -80,14 +80,11 @@ class AffineChannelOp : public framework::OperatorWithKernel {
PADDLE_ENFORCE_EQ
(
scale_dims
.
size
(),
1UL
);
PADDLE_ENFORCE_EQ
(
scale_dims
.
size
(),
1UL
);
PADDLE_ENFORCE_EQ
(
b_dims
.
size
(),
1UL
);
PADDLE_ENFORCE_EQ
(
b_dims
.
size
(),
1UL
);
if
(
ctx
->
IsRuntime
())
{
if
(
ctx
->
IsRuntime
()
||
scale_dims
[
0
]
>
0
)
{
PADDLE_ENFORCE_EQ
(
scale_dims
[
0
],
C
);
PADDLE_ENFORCE_EQ
(
scale_dims
[
0
],
C
);
}
if
(
ctx
->
IsRuntime
()
||
b_dims
[
0
]
>
0
)
{
PADDLE_ENFORCE_EQ
(
b_dims
[
0
],
C
);
PADDLE_ENFORCE_EQ
(
b_dims
[
0
],
C
);
}
else
{
if
(
scale_dims
[
0
]
>
0
&&
b_dims
[
0
]
>
0
)
{
PADDLE_ENFORCE_EQ
(
scale_dims
[
0
],
C
);
PADDLE_ENFORCE_EQ
(
b_dims
[
0
],
C
);
}
}
}
ctx
->
SetOutputDim
(
"Out"
,
ctx
->
GetInputDim
(
"X"
));
ctx
->
SetOutputDim
(
"Out"
,
ctx
->
GetInputDim
(
"X"
));
...
...
paddle/fluid/operators/conv_op.cc
浏览文件 @
e0f7bf4f
...
@@ -69,7 +69,7 @@ void ConvOp::InferShape(framework::InferShapeContext* ctx) const {
...
@@ -69,7 +69,7 @@ void ConvOp::InferShape(framework::InferShapeContext* ctx) const {
std
::
vector
<
int64_t
>
output_shape
({
in_dims
[
0
],
filter_dims
[
0
]});
std
::
vector
<
int64_t
>
output_shape
({
in_dims
[
0
],
filter_dims
[
0
]});
for
(
size_t
i
=
0
;
i
<
strides
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
strides
.
size
();
++
i
)
{
if
((
!
ctx
->
IsRuntime
())
&&
if
((
!
ctx
->
IsRuntime
())
&&
(
in_dims
[
i
+
2
]
==
-
1
||
filter_dims
[
i
+
2
]
==
-
1
))
{
(
in_dims
[
i
+
2
]
<=
0
||
filter_dims
[
i
+
2
]
<=
0
))
{
output_shape
.
push_back
(
-
1
);
output_shape
.
push_back
(
-
1
);
}
else
{
}
else
{
output_shape
.
push_back
(
ConvOutputSize
(
in_dims
[
i
+
2
],
filter_dims
[
i
+
2
],
output_shape
.
push_back
(
ConvOutputSize
(
in_dims
[
i
+
2
],
filter_dims
[
i
+
2
],
...
...
paddle/fluid/operators/roi_pool_op.cc
浏览文件 @
e0f7bf4f
...
@@ -50,14 +50,12 @@ class ROIPoolOp : public framework::OperatorWithKernel {
...
@@ -50,14 +50,12 @@ class ROIPoolOp : public framework::OperatorWithKernel {
int
pooled_width
=
ctx
->
Attrs
().
Get
<
int
>
(
"pooled_width"
);
int
pooled_width
=
ctx
->
Attrs
().
Get
<
int
>
(
"pooled_width"
);
float
spatial_scale
=
ctx
->
Attrs
().
Get
<
float
>
(
"spatial_scale"
);
float
spatial_scale
=
ctx
->
Attrs
().
Get
<
float
>
(
"spatial_scale"
);
if
(
ctx
->
IsRuntime
())
{
PADDLE_ENFORCE_GT
(
pooled_height
,
0
,
PADDLE_ENFORCE_GT
(
pooled_height
,
0
,
"The pooled output height must greater than 0"
);
"The pooled output height must greater than 0"
);
PADDLE_ENFORCE_GT
(
pooled_width
,
0
,
PADDLE_ENFORCE_GT
(
pooled_width
,
0
,
"The pooled output width must greater than 0"
);
"The pooled output width must greater than 0"
);
PADDLE_ENFORCE_GT
(
spatial_scale
,
0.0
f
,
PADDLE_ENFORCE_GT
(
spatial_scale
,
0.0
f
,
"The spatial scale must greater than 0"
);
"The spatial scale must greater than 0"
);
}
auto
out_dims
=
input_dims
;
auto
out_dims
=
input_dims
;
out_dims
[
0
]
=
rois_dims
[
0
];
out_dims
[
0
]
=
rois_dims
[
0
];
...
...
paddle/fluid/operators/row_conv_op.cc
浏览文件 @
e0f7bf4f
...
@@ -45,16 +45,10 @@ class RowConvOp : public framework::OperatorWithKernel {
...
@@ -45,16 +45,10 @@ class RowConvOp : public framework::OperatorWithKernel {
auto
filter_dims
=
ctx
->
GetInputDim
(
"Filter"
);
auto
filter_dims
=
ctx
->
GetInputDim
(
"Filter"
);
PADDLE_ENFORCE_EQ
(
x_dims
.
size
(),
2
,
"Input(X)'s rank should be 2."
);
PADDLE_ENFORCE_EQ
(
x_dims
.
size
(),
2
,
"Input(X)'s rank should be 2."
);
PADDLE_ENFORCE_EQ
(
filter_dims
.
size
(),
2
,
"Input(Y)'s rank should be 2."
);
PADDLE_ENFORCE_EQ
(
filter_dims
.
size
(),
2
,
"Input(Y)'s rank should be 2."
);
if
(
ctx
->
IsRuntime
())
{
if
(
ctx
->
IsRuntime
()
||
(
x_dims
[
1
]
>
0
&&
filter_dims
[
1
]
>
0
)
)
{
PADDLE_ENFORCE_EQ
(
PADDLE_ENFORCE_EQ
(
x_dims
[
1
],
filter_dims
[
1
],
x_dims
[
1
],
filter_dims
[
1
],
"The 2nd dimension of Input(X) and Input(Filter) should be same."
);
"The 2nd dimension of Input(X) and Input(Filter) should be same."
);
}
else
{
if
(
x_dims
[
1
]
>
0
&&
filter_dims
[
1
]
>
0
)
{
PADDLE_ENFORCE_EQ
(
x_dims
[
1
],
filter_dims
[
1
],
"The 2nd dimension of Input(X) and Input(Filter) should be same."
);
}
}
}
ctx
->
SetOutputDim
(
"Out"
,
x_dims
);
ctx
->
SetOutputDim
(
"Out"
,
x_dims
);
...
...
paddle/fluid/operators/unpool_op.cc
浏览文件 @
e0f7bf4f
...
@@ -102,7 +102,7 @@ class UnpoolOp : public framework::OperatorWithKernel {
...
@@ -102,7 +102,7 @@ class UnpoolOp : public framework::OperatorWithKernel {
std
::
vector
<
int64_t
>
output_shape
({
in_x_dims
[
0
],
in_x_dims
[
1
]});
std
::
vector
<
int64_t
>
output_shape
({
in_x_dims
[
0
],
in_x_dims
[
1
]});
for
(
size_t
i
=
0
;
i
<
ksize
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
ksize
.
size
();
++
i
)
{
if
(
!
ctx
->
IsRuntime
()
&&
in_x_dims
[
i
+
2
]
==
-
1
)
{
if
(
!
ctx
->
IsRuntime
()
&&
in_x_dims
[
i
+
2
]
<=
0
)
{
output_shape
.
push_back
(
-
1
);
output_shape
.
push_back
(
-
1
);
}
else
{
}
else
{
output_shape
.
push_back
(
UnpoolOutputSize
(
in_x_dims
[
i
+
2
],
ksize
[
i
],
output_shape
.
push_back
(
UnpoolOutputSize
(
in_x_dims
[
i
+
2
],
ksize
[
i
],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录