Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OPTHREE
Paddle
提交
d150c3a6
P
Paddle
项目概览
OPTHREE
/
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,发现更多精彩内容 >>
未验证
提交
d150c3a6
编写于
9月 26, 2022
作者:
Y
Yuanle Liu
提交者:
GitHub
9月 26, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test=infer-coverage fix passes test bug on A10 (#46480)
上级
091ae705
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
40 addition
and
37 deletion
+40
-37
.gitignore
.gitignore
+1
-0
python/paddle/fluid/tests/unittests/ir/inference/test_conv_elementwise_add2_act_fuse_pass.py
.../ir/inference/test_conv_elementwise_add2_act_fuse_pass.py
+27
-20
python/paddle/fluid/tests/unittests/ir/inference/test_conv_elementwise_add_act_fuse_pass.py
...s/ir/inference/test_conv_elementwise_add_act_fuse_pass.py
+6
-9
python/paddle/fluid/tests/unittests/ir/inference/test_conv_eltwiseadd_bn_fuse_pass.py
...ittests/ir/inference/test_conv_eltwiseadd_bn_fuse_pass.py
+6
-8
未找到文件。
.gitignore
浏览文件 @
d150c3a6
...
...
@@ -53,6 +53,7 @@ model_test
Testing
tools/__pycache__
tools/nvcc_lazy
# This file is automatically generated.
# TODO(zhiqiang) Move this file to build directory.
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_conv_elementwise_add2_act_fuse_pass.py
浏览文件 @
d150c3a6
...
...
@@ -12,18 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
auto_scan_test
import
PassAutoScanTest
,
SkipReasons
from
auto_scan_test
import
PassAutoScanTest
from
program_config
import
TensorConfig
,
ProgramConfig
,
OpConfig
import
numpy
as
np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
from
typing
import
Optional
,
List
,
Callable
,
Dict
,
Any
,
Set
import
unittest
import
hypothesis
from
hypothesis
import
given
,
settings
,
seed
,
example
,
assume
,
reproduce_failure
import
os
import
hypothesis.strategies
as
st
os
.
environ
[
'NVIDIA_TF32_OVERRIDE'
]
=
'0'
class
TestConvElementwiseAdd2ActPass
(
PassAutoScanTest
):
"""
...
...
@@ -62,11 +59,11 @@ class TestConvElementwiseAdd2ActPass(PassAutoScanTest):
return
False
if
padding_algorithm
==
"VALID"
:
if
int
(((
input_shape
[
2
]
-
(
dilations
[
0
]
*
(
filter_shape
[
2
]
-
1
)
+
1
))
/
strides
[
0
]
+
1
))
<=
0
or
\
int
(((
input_shape
[
3
]
-
(
dilations
[
1
]
*
(
filter_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
))
<=
0
:
int
(((
input_shape
[
3
]
-
(
dilations
[
1
]
*
(
filter_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
))
<=
0
:
return
False
if
padding_algorithm
==
"EXPLICIT"
:
if
int
(((
input_shape
[
2
]
+
paddings
[
0
]
+
paddings
[
1
]
-
(
dilations
[
0
]
*
(
filter_shape
[
2
]
-
1
)
+
1
))
/
strides
[
0
]
+
1
))
<=
0
or
\
int
(((
input_shape
[
3
]
+
paddings
[
2
]
+
paddings
[
3
]
-
(
dilations
[
1
]
*
(
filter_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
))
<=
0
:
int
(((
input_shape
[
3
]
+
paddings
[
2
]
+
paddings
[
3
]
-
(
dilations
[
1
]
*
(
filter_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
))
<=
0
:
return
False
if
padding_algorithm
==
"SAME"
:
if
int
((
input_shape
[
2
]
+
strides
[
0
]
-
1
)
/
strides
[
0
])
<=
0
or
int
(
...
...
@@ -137,17 +134,27 @@ class TestConvElementwiseAdd2ActPass(PassAutoScanTest):
# 9. Generate legal elemntwise_add: X of conv2d
bias_2_dict
=
dict
()
bias_2_dict
[
1
]
=
[
x_shape
[
0
],
f_shape
[
0
],
\
int
(((
x_shape
[
2
]
+
padding
[
0
]
+
padding
[
1
]
-
(
dilations
[
0
]
*
(
f_shape
[
2
]
-
1
)
+
1
))
/
strides
[
0
]
+
1
)),
\
int
(((
x_shape
[
3
]
+
padding
[
2
]
+
padding
[
3
]
-
(
dilations
[
1
]
*
(
f_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
))]
bias_2_dict
[
2
]
=
[
x_shape
[
0
],
f_shape
[
0
],
\
int
((
x_shape
[
2
]
+
strides
[
0
]
-
1
)
/
strides
[
0
]),
\
int
((
x_shape
[
3
]
+
strides
[
1
]
-
1
)
/
strides
[
1
])]
bias_2_dict
[
3
]
=
[
x_shape
[
0
],
f_shape
[
0
],
\
int
(((
x_shape
[
2
]
-
(
dilations
[
0
]
*
(
f_shape
[
2
]
-
1
)
+
1
))
/
strides
[
0
]
+
1
)),
\
int
(((
x_shape
[
3
]
-
(
dilations
[
1
]
*
(
f_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
))]
bias_2_dict
[
1
]
=
[
x_shape
[
0
],
f_shape
[
0
],
int
(((
x_shape
[
2
]
+
padding
[
0
]
+
padding
[
1
]
-
(
dilations
[
0
]
*
(
f_shape
[
2
]
-
1
)
+
1
))
/
strides
[
0
]
+
1
)),
int
(((
x_shape
[
3
]
+
padding
[
2
]
+
padding
[
3
]
-
(
dilations
[
1
]
*
(
f_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
))
]
bias_2_dict
[
2
]
=
[
x_shape
[
0
],
f_shape
[
0
],
int
((
x_shape
[
2
]
+
strides
[
0
]
-
1
)
/
strides
[
0
]),
int
((
x_shape
[
3
]
+
strides
[
1
]
-
1
)
/
strides
[
1
])
]
bias_2_dict
[
3
]
=
[
x_shape
[
0
],
f_shape
[
0
],
int
(((
x_shape
[
2
]
-
(
dilations
[
0
]
*
(
f_shape
[
2
]
-
1
)
+
1
))
/
strides
[
0
]
+
1
)),
int
(((
x_shape
[
3
]
-
(
dilations
[
1
]
*
(
f_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
))
]
bias_index
=
1
if
padding_algorithm
==
"SAME"
:
bias_index
=
2
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_conv_elementwise_add_act_fuse_pass.py
浏览文件 @
d150c3a6
...
...
@@ -12,18 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
auto_scan_test
import
PassAutoScanTest
,
IgnoreReasons
from
auto_scan_test
import
PassAutoScanTest
from
program_config
import
TensorConfig
,
ProgramConfig
,
OpConfig
import
numpy
as
np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
from
typing
import
Optional
,
List
,
Callable
,
Dict
,
Any
,
Set
import
unittest
import
hypothesis
from
hypothesis
import
given
,
settings
,
seed
,
example
,
assume
,
reproduce_failure
import
os
import
hypothesis.strategies
as
st
os
.
environ
[
'NVIDIA_TF32_OVERRIDE'
]
=
'0'
class
TestConvElementwiseAddActPass
(
PassAutoScanTest
):
"""
...
...
@@ -60,11 +57,11 @@ class TestConvElementwiseAddActPass(PassAutoScanTest):
return
False
if
padding_algorithm
==
"VALID"
:
if
((
input_shape
[
2
]
-
(
dilations
[
0
]
*
(
filter_shape
[
2
]
-
1
)
+
1
))
/
strides
[
0
]
+
1
)
<=
1
or
\
((
input_shape
[
3
]
-
(
dilations
[
1
]
*
(
filter_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
)
<=
1
:
((
input_shape
[
3
]
-
(
dilations
[
1
]
*
(
filter_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
)
<=
1
:
return
False
if
padding_algorithm
==
"EXPLICIT"
:
if
((
input_shape
[
2
]
+
paddings
[
0
]
+
paddings
[
1
]
-
(
dilations
[
0
]
*
(
filter_shape
[
2
]
-
1
)
+
1
))
/
strides
[
0
]
+
1
)
<=
1
or
\
((
input_shape
[
3
]
+
paddings
[
2
]
+
paddings
[
3
]
-
(
dilations
[
1
]
*
(
filter_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
)
<=
1
:
((
input_shape
[
3
]
+
paddings
[
2
]
+
paddings
[
3
]
-
(
dilations
[
1
]
*
(
filter_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
)
<=
1
:
return
False
if
data_format
==
"NCHW"
:
if
input_shape
[
1
]
!=
filter_shape
[
1
]
*
groups
:
...
...
python/paddle/fluid/tests/unittests/ir/inference/test_conv_eltwiseadd_bn_fuse_pass.py
浏览文件 @
d150c3a6
...
...
@@ -12,18 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
auto_scan_test
import
PassAutoScanTest
,
SkipReasons
from
auto_scan_test
import
PassAutoScanTest
from
program_config
import
TensorConfig
,
ProgramConfig
,
OpConfig
import
numpy
as
np
import
paddle.inference
as
paddle_infer
from
functools
import
partial
from
typing
import
Optional
,
List
,
Callable
,
Dict
,
Any
,
Set
import
unittest
import
os
import
hypothesis
from
hypothesis
import
given
,
settings
,
seed
,
example
,
assume
,
reproduce_failure
import
hypothesis.strategies
as
st
os
.
environ
[
'NVIDIA_TF32_OVERRIDE'
]
=
'0'
class
TestConvEltwiseaddBnFusePass
(
PassAutoScanTest
):
"""
...
...
@@ -69,11 +67,11 @@ class TestConvEltwiseaddBnFusePass(PassAutoScanTest):
return
False
if
padding_algorithm
==
"VALID"
:
if
((
input_shape
[
2
]
-
(
dilations
[
0
]
*
(
filter_shape
[
2
]
-
1
)
+
1
))
/
strides
[
0
]
+
1
)
<=
1
or
\
((
input_shape
[
3
]
-
(
dilations
[
1
]
*
(
filter_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
)
<=
1
:
((
input_shape
[
3
]
-
(
dilations
[
1
]
*
(
filter_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
)
<=
1
:
return
False
if
padding_algorithm
==
"EXPLICIT"
:
if
((
input_shape
[
2
]
+
paddings
[
0
]
+
paddings
[
1
]
-
(
dilations
[
0
]
*
(
filter_shape
[
2
]
-
1
)
+
1
))
/
strides
[
0
]
+
1
)
<=
1
or
\
((
input_shape
[
3
]
+
paddings
[
2
]
+
paddings
[
3
]
-
(
dilations
[
1
]
*
(
filter_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
)
<=
1
:
((
input_shape
[
3
]
+
paddings
[
2
]
+
paddings
[
3
]
-
(
dilations
[
1
]
*
(
filter_shape
[
3
]
-
1
)
+
1
))
/
strides
[
1
]
+
1
)
<=
1
:
return
False
if
data_format
==
"NCHW"
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录