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
134a2f25
Commit
134a2f25
authored
May 13, 2019
by
Joshua Z. Zhang
Committed by
Tianqi Chen
May 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add onnx elemwise greater/less (#3186)
parent
f72c763f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
python/tvm/relay/frontend/onnx.py
+19
-0
tests/python/frontend/onnx/test_forward.py
+2
-0
No files found.
python/tvm/relay/frontend/onnx.py
View file @
134a2f25
...
@@ -622,6 +622,23 @@ class Gather(OnnxOpConverter):
...
@@ -622,6 +622,23 @@ class Gather(OnnxOpConverter):
extras
=
{
'axis'
:
axis
})(
inputs
,
{})
extras
=
{
'axis'
:
axis
})(
inputs
,
{})
#return _op.take(inputs[0], inputs[1], axis)
#return _op.take(inputs[0], inputs[1], axis)
class
Greater
(
OnnxOpConverter
):
""" Operator logical greater.
"""
@classmethod
def
_impl_v7
(
cls
,
inputs
,
attr
,
params
):
return
_op
.
greater
(
inputs
[
0
],
inputs
[
1
])
class
Less
(
OnnxOpConverter
):
""" Operator logical less than.
"""
@classmethod
def
_impl_v7
(
cls
,
inputs
,
attr
,
params
):
return
_op
.
less
(
inputs
[
0
],
inputs
[
1
])
class
LRN
(
OnnxOpConverter
):
class
LRN
(
OnnxOpConverter
):
""" Operator converter for Local Response Normalization.
""" Operator converter for Local Response Normalization.
"""
"""
...
@@ -836,6 +853,8 @@ def _get_convert_map(opset):
...
@@ -836,6 +853,8 @@ def _get_convert_map(opset):
'Selu'
:
Selu
.
get_converter
(
opset
),
'Selu'
:
Selu
.
get_converter
(
opset
),
'Elu'
:
Elu
.
get_converter
(
opset
),
'Elu'
:
Elu
.
get_converter
(
opset
),
'Exp'
:
Renamer
(
'exp'
),
'Exp'
:
Renamer
(
'exp'
),
'Greater'
:
Greater
.
get_converter
(
opset
),
'Less'
:
Less
.
get_converter
(
opset
),
'Log'
:
Renamer
(
'log'
),
'Log'
:
Renamer
(
'log'
),
'Tanh'
:
Renamer
(
'tanh'
),
'Tanh'
:
Renamer
(
'tanh'
),
'Pow'
:
Renamer
(
'power'
),
'Pow'
:
Renamer
(
'power'
),
...
...
tests/python/frontend/onnx/test_forward.py
View file @
134a2f25
...
@@ -955,6 +955,8 @@ def test_binary_ops():
...
@@ -955,6 +955,8 @@ def test_binary_ops():
verify_binary_ops
(
"Div"
,
x
,
y
,
x
/
y
,
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
(
"Div"
,
x
,
z
,
x
/
z
,
broadcast
=
True
)
verify_binary_ops
(
"Sum"
,
x
,
y
,
x
+
y
,
broadcast
=
None
)
verify_binary_ops
(
"Sum"
,
x
,
y
,
x
+
y
,
broadcast
=
None
)
verify_binary_ops
(
"Greater"
,
x
,
y
,
x
>
y
,
broadcast
=
True
)
verify_binary_ops
(
"Less"
,
x
,
y
,
x
<
y
,
broadcast
=
True
)
def
test_single_ops
():
def
test_single_ops
():
in_shape
=
(
1
,
2
,
3
,
3
)
in_shape
=
(
1
,
2
,
3
,
3
)
...
...
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