Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sum #873

Merged
merged 117 commits into from Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
cffcfd5
Update onnx_decoder.py
qqj1130247885 Jul 25, 2022
a05f36e
Update opset.py
qqj1130247885 Jul 25, 2022
ae260eb
Update opset.py
qqj1130247885 Jul 25, 2022
02355da
Update opset.py
qqj1130247885 Jul 25, 2022
451b43a
Update onnx_decoder.py
qqj1130247885 Jul 25, 2022
99e7599
Merge remote-tracking branch 'upstream/develop' into fix
qqj1130247885 Jul 25, 2022
392a9db
fix gemm and resize
qqj1130247885 Jul 27, 2022
1118bef
Merge remote-tracking branch 'op_test/add_autoscan_test' into develop
qqj1130247885 Jul 27, 2022
48a9ae9
Merge branch 'fix_resize_gemm' into develop
qqj1130247885 Aug 2, 2022
96ebd16
Merge remote-tracking branch 'upstream/develop' into auto_test
qqj1130247885 Aug 2, 2022
1756aaf
add auto_test of 1 input ops
qqj1130247885 Aug 2, 2022
d22c3ea
Update onnx_decoder.py
qqj1130247885 Aug 2, 2022
3beef68
Update opset_legacy.py
qqj1130247885 Aug 2, 2022
43f1fa8
Update opset_legacy.py
qqj1130247885 Aug 2, 2022
ca1fb1f
Update onnx_decoder.py
qqj1130247885 Aug 2, 2022
1780f92
Update opset_legacy.py
qqj1130247885 Aug 2, 2022
6327cea
Update opset_legacy.py
qqj1130247885 Aug 2, 2022
8f70001
Update opset_legacy.py
qqj1130247885 Aug 2, 2022
0a16de1
Update test_auto_scan_one_input_ops_float32.py
qqj1130247885 Aug 2, 2022
63e2f4f
Delete test_auto_scan_one_input_ops_float32.py
qqj1130247885 Aug 2, 2022
4e3bd88
Create test_auto_scan_one_input_ops_float32.py
qqj1130247885 Aug 2, 2022
f93208c
Update opset_legacy.py
qqj1130247885 Aug 2, 2022
6b7ae08
test
qqj1130247885 Aug 3, 2022
d359f2c
add test of Tan
qqj1130247885 Aug 3, 2022
2383ae7
rename
qqj1130247885 Aug 3, 2022
0e0e287
add ops in directly map
qqj1130247885 Aug 3, 2022
4e75ad1
keep op_legacy
qqj1130247885 Aug 3, 2022
dfb332d
Delete test_auto_scan_one_input_ops_float32.py
qqj1130247885 Aug 3, 2022
9e412cf
modify the name
qqj1130247885 Aug 3, 2022
6278660
Merge branch 'auto_test' of https://github.com/qqj1130247885/X2Paddle…
qqj1130247885 Aug 3, 2022
fff2ce4
fix
qqj1130247885 Aug 3, 2022
86b8736
add ceil op
qqj1130247885 Aug 4, 2022
90441af
modify opset7
qqj1130247885 Aug 4, 2022
10e142c
Delete test_auto_scan_unarray_ops.py
qqj1130247885 Aug 4, 2022
72a69ec
add test of elu
qqj1130247885 Aug 4, 2022
4f88ea3
Update test_auto_scan_unary_ops.py
qqj1130247885 Aug 4, 2022
b83c145
Update test_auto_scan_elu.py
qqj1130247885 Aug 4, 2022
3cee6e3
Update test_auto_scan_elu.py
qqj1130247885 Aug 4, 2022
c74102a
fixx
qqj1130247885 Aug 4, 2022
806aed4
test
qqj1130247885 Aug 4, 2022
c7d7322
test
qqj1130247885 Aug 4, 2022
aa30f6a
test
qqj1130247885 Aug 4, 2022
019f43c
test
qqj1130247885 Aug 4, 2022
1636677
add ref
qqj1130247885 Aug 4, 2022
2bb1c06
add sinh + tanh
qqj1130247885 Aug 4, 2022
70e11e8
add sinh + tanh
qqj1130247885 Aug 4, 2022
100c9ff
add sinh + tanh
qqj1130247885 Aug 4, 2022
48b899e
add sin Sinh tang
qqj1130247885 Aug 4, 2022
cda4839
Update opset7.py
qqj1130247885 Aug 4, 2022
f41ee72
add :cosh,acosh,sinh,acosh
qqj1130247885 Aug 4, 2022
0ef8816
try
qqj1130247885 Aug 4, 2022
a43dd08
try
qqj1130247885 Aug 4, 2022
9433d2e
add Atanh
qqj1130247885 Aug 4, 2022
92e0f68
add Atanh
qqj1130247885 Aug 4, 2022
3836727
s
qqj1130247885 Aug 4, 2022
db318c8
s
qqj1130247885 Aug 4, 2022
ebf9a89
add Sqrt
qqj1130247885 Aug 4, 2022
cc8a9d0
s
qqj1130247885 Aug 4, 2022
f1dbe66
add shape
qqj1130247885 Aug 4, 2022
67a1e3f
s
qqj1130247885 Aug 4, 2022
69b1ac2
add sign
qqj1130247885 Aug 4, 2022
d695daf
add_celu
qqj1130247885 Aug 5, 2022
5587931
Delete test_auto_scan_elu.py
qqj1130247885 Aug 5, 2022
0451348
Delete test_auto_scan_unary_ops.py
qqj1130247885 Aug 5, 2022
a3937ed
Delete opset7.py
qqj1130247885 Aug 5, 2022
abd1260
复原
qqj1130247885 Aug 5, 2022
f50943f
add Celu
qqj1130247885 Aug 5, 2022
00ca749
Update opset7.py
qqj1130247885 Aug 5, 2022
dae3943
Update opset9.py
qqj1130247885 Aug 5, 2022
916f69b
Merge branch 'PaddlePaddle:develop' into develop
qqj1130247885 Aug 8, 2022
8b4b423
add selu
qqj1130247885 Aug 8, 2022
47b9979
Update opset7.py
qqj1130247885 Aug 8, 2022
39162be
add relu
qqj1130247885 Aug 8, 2022
e352bde
update relu datatype
qqj1130247885 Aug 8, 2022
0e9be71
Update opset14.py
qqj1130247885 Aug 8, 2022
5f9174d
fix code style
qqj1130247885 Aug 8, 2022
409be3c
fix code style
qqj1130247885 Aug 8, 2022
613fd35
Merge branch 'PaddlePaddle:develop' into develop
qqj1130247885 Aug 9, 2022
6f8693e
add_hardsigmoid
qqj1130247885 Aug 9, 2022
21935f8
add_reduce_op
qqj1130247885 Aug 9, 2022
62d5a01
fix
qqj1130247885 Aug 9, 2022
0fc1532
fix
qqj1130247885 Aug 9, 2022
721dab2
add reduceL2
qqj1130247885 Aug 9, 2022
92f616c
add relu
qqj1130247885 Aug 9, 2022
ff84e33
test
qqj1130247885 Aug 9, 2022
9885114
remove log and exp
qqj1130247885 Aug 9, 2022
46657e0
add selu in opset7
qqj1130247885 Aug 9, 2022
374f0e5
Delete test_auto_scan_celu.py
qqj1130247885 Aug 9, 2022
944b7ab
Delete test_auto_scan_relu.py
qqj1130247885 Aug 9, 2022
48088dd
Delete test_auto_scan_reduce_ops.py
qqj1130247885 Aug 9, 2022
12a8ec1
Delete test_auto_scan_hardsigmoid.py
qqj1130247885 Aug 9, 2022
b613e43
add selu in opset7
qqj1130247885 Aug 9, 2022
2b00d7b
add selu in opset12
qqj1130247885 Aug 9, 2022
24e66c0
add selu in opset14
qqj1130247885 Aug 9, 2022
0ab5230
Update opset7.py
qqj1130247885 Aug 9, 2022
d72db35
Update opset12.py
qqj1130247885 Aug 9, 2022
60c500c
Update opset14.py
qqj1130247885 Aug 9, 2022
2718c0b
Update test_auto_scan_unary_ops.py
qqj1130247885 Aug 9, 2022
77a8e08
Update opset14.py
qqj1130247885 Aug 9, 2022
076999f
add elu
qqj1130247885 Aug 9, 2022
d0738fa
Merge branch 'auto_test' of https://github.com/qqj1130247885/X2Paddle…
qqj1130247885 Aug 9, 2022
2ff088b
fix style
qqj1130247885 Aug 9, 2022
59d3758
fix style
qqj1130247885 Aug 9, 2022
a122cde
remove onnx
qqj1130247885 Aug 10, 2022
4791dc8
add auto scan test of softplus
qqj1130247885 Aug 10, 2022
6263731
Merge branch 'auto_test' of https://github.com/qqj1130247885/X2Paddle…
qqj1130247885 Aug 10, 2022
06f1361
add auto scan test of sigmoid
qqj1130247885 Aug 10, 2022
52ac9c1
add test of sum OP in version 7
qqj1130247885 Aug 12, 2022
c6c3feb
add test of sum OP in version 8
qqj1130247885 Aug 12, 2022
463c259
add test of sum OP in version 8
qqj1130247885 Aug 12, 2022
2bf0057
Delete test_auto_scan_elu.py
qqj1130247885 Aug 12, 2022
bbc8d3c
Delete test_auto_scan_unary_ops.py
qqj1130247885 Aug 12, 2022
a7365af
remove
qqj1130247885 Aug 12, 2022
d8c45e1
remove
qqj1130247885 Aug 12, 2022
0d95ce4
retest
qqj1130247885 Aug 18, 2022
250f670
Merge remote-tracking branch 'upstream/develop' into add_sum
qqj1130247885 Aug 18, 2022
87ac3d7
test
qqj1130247885 Aug 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
59 changes: 59 additions & 0 deletions tests/onnx/test_auto_scan_sum_7.py
@@ -0,0 +1,59 @@
# Copyright (c) 2022 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 auto_scan_test import OPConvertAutoScanTest
from hypothesis import reproduce_failure
from onnxbase import randtool
import hypothesis.strategies as st
import numpy as np
import unittest


class TestSumConvert(OPConvertAutoScanTest):
"""
ONNX op: Sum
OPset version: 7
"""

def sample_convert_config(self, draw):
input1_shape = draw(
st.lists(
st.integers(
min_value=10, max_value=20), min_size=2, max_size=4))

input_dtype = draw(st.sampled_from(["float32"]))

config = {
"op_names": ["Sum"],
"test_data_shapes": [input1_shape, input1_shape],
"test_data_types": [[input_dtype], [input_dtype]],
"inputs_shape": [],
"min_opset_version": 7,
"max_opset_version": 7,
"inputs_name": ["x", "y"],
"outputs_name": ["z"],
"delta": 1e-4,
"rtol": 1e-4
}

attrs = {}

return (config, attrs)

def test(self):
self.run_and_statis(max_examples=30)


if __name__ == "__main__":
unittest.main()
67 changes: 67 additions & 0 deletions tests/onnx/test_auto_scan_sum_8.py
@@ -0,0 +1,67 @@
# Copyright (c) 2022 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 auto_scan_test import OPConvertAutoScanTest
from hypothesis import reproduce_failure
from onnxbase import randtool
import hypothesis.strategies as st
import numpy as np
import unittest


class TestSumConvert(OPConvertAutoScanTest):
"""
ONNX op: Sum
OPset version: 8~15
"""

def sample_convert_config(self, draw):
input1_shape = draw(
st.lists(
st.integers(
min_value=10, max_value=20), min_size=2, max_size=4))

if draw(st.booleans()):
input2_shape = [input1_shape[-1]]
else:
input2_shape = input1_shape

def generator_data():
input_data = randtool("float", -5.0, 5.0, input2_shape)
input_data[abs(input_data) < 1.0] = 1.0
return input_data

input_dtype = draw(st.sampled_from(["float32"]))
config = {
"op_names": ["Sum"],
"test_data_shapes": [input1_shape, generator_data],
"test_data_types": [[input_dtype], [input_dtype]],
"inputs_shape": [],
"min_opset_version": 8,
"inputs_name": ["x", "y"],
"outputs_name": ["z"],
"delta": 1e-4,
"rtol": 1e-4
}

attrs = {}

return (config, attrs)

def test(self):
self.run_and_statis(max_examples=30)


if __name__ == "__main__":
unittest.main()