Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
5ce2c296
Unverified
Commit
5ce2c296
authored
Apr 21, 2020
by
Josh Fromm
Committed by
GitHub
Apr 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to have multiple copies of same input to onnx_inputs. (#5389)
parent
4cebb1c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
python/tvm/relay/frontend/onnx.py
+1
-2
tests/python/frontend/onnx/test_forward.py
+6
-5
No files found.
python/tvm/relay/frontend/onnx.py
View file @
5ce2c296
...
...
@@ -57,8 +57,7 @@ class onnx_input():
if
isinstance
(
item
,
int
):
self
.
input_dict
[
self
.
input_keys
[
item
]]
=
value
elif
isinstance
(
item
,
str
):
if
item
not
in
self
.
input_dict
:
self
.
input_keys
.
append
(
item
)
self
.
input_keys
.
append
(
item
)
self
.
input_dict
[
item
]
=
value
else
:
raise
ValueError
(
"Only integer and string indexed writes allowed."
)
...
...
tests/python/frontend/onnx/test_forward.py
View file @
5ce2c296
...
...
@@ -1366,16 +1366,16 @@ def test_binary_ops():
dtype
=
"float32"
out_shape
=
in_shape
def
verify_binary_ops
(
op
,
x
,
y
,
out_np
,
broadcast
=
None
):
def
verify_binary_ops
(
op
,
x
,
y
,
out_np
,
x_name
=
'in1'
,
y_name
=
'in2'
,
broadcast
=
None
):
if
broadcast
is
None
:
z
=
helper
.
make_node
(
op
,
[
'in1'
,
'in2'
],
[
'out'
])
z
=
helper
.
make_node
(
op
,
[
x_name
,
y_name
],
[
'out'
])
else
:
z
=
helper
.
make_node
(
op
,
[
'in1'
,
'in2'
],
[
'out'
],
broadcast
=
1
)
z
=
helper
.
make_node
(
op
,
[
x_name
,
y_name
],
[
'out'
],
broadcast
=
1
)
graph
=
helper
.
make_graph
([
z
],
'_test'
,
inputs
=
[
helper
.
make_tensor_value_info
(
"in1"
,
inputs
=
[
helper
.
make_tensor_value_info
(
x_name
,
TensorProto
.
FLOAT
,
list
(
in_shape
)),
helper
.
make_tensor_value_info
(
"in2"
,
helper
.
make_tensor_value_info
(
y_name
,
TensorProto
.
FLOAT
,
list
(
in_shape
))],
outputs
=
[
helper
.
make_tensor_value_info
(
"out"
,
TensorProto
.
FLOAT
,
list
(
out_shape
))])
...
...
@@ -1393,6 +1393,7 @@ def test_binary_ops():
verify_binary_ops
(
"Sub"
,
x
,
z
,
x
-
z
,
broadcast
=
True
)
verify_binary_ops
(
"Mul"
,
x
,
y
,
x
*
y
,
broadcast
=
None
)
verify_binary_ops
(
"Mul"
,
x
,
z
,
x
*
z
,
broadcast
=
True
)
verify_binary_ops
(
"Mul"
,
x
,
x
,
x
*
x
,
x_name
=
'in1'
,
y_name
=
'in1'
,
broadcast
=
None
)
verify_binary_ops
(
"Div"
,
x
,
y
,
x
/
y
,
broadcast
=
None
)
verify_binary_ops
(
"Div"
,
x
,
z
,
x
/
z
,
broadcast
=
True
)
verify_binary_ops
(
"Sum"
,
x
,
y
,
x
+
y
,
broadcast
=
None
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment