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
5e7fbaef
Unverified
Commit
5e7fbaef
authored
Mar 12, 2020
by
Samuel
Committed by
GitHub
Mar 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TFLITE]Round op parsing support added (#5022)
parent
95e7e34f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
python/tvm/relay/frontend/tflite.py
+8
-0
tests/python/frontend/tflite/test_forward.py
+10
-0
No files found.
python/tvm/relay/frontend/tflite.py
View file @
5e7fbaef
...
...
@@ -109,6 +109,7 @@ class OperatorConverter(object):
'RESHAPE'
:
self
.
convert_reshape
,
'RESIZE_BILINEAR'
:
self
.
convert_resize_bilinear
,
'RESIZE_NEAREST_NEIGHBOR'
:
self
.
convert_resize_nearest_neighbor
,
'ROUND'
:
self
.
convert_round
,
'RSQRT'
:
self
.
convert_rsqrt
,
'SIN'
:
self
.
convert_sin
,
'SLICE'
:
self
.
convert_slice
,
...
...
@@ -676,6 +677,13 @@ class OperatorConverter(object):
'TFlite quantized FLOOR operator is not supported yet.'
)
return
self
.
_convert_unary_elemwise
(
_op
.
floor
,
op
)
def
convert_round
(
self
,
op
):
"""Convert TFLite ROUND"""
if
self
.
is_quantized
(
op
):
raise
tvm
.
error
.
OpNotImplemented
(
'TFlite quantized ROUND operator is not supported yet.'
)
return
self
.
_convert_unary_elemwise
(
_op
.
round
,
op
)
def
convert_exp
(
self
,
op
):
"""Convert TFLite EXP"""
if
self
.
is_quantized
(
op
):
...
...
tests/python/frontend/tflite/test_forward.py
View file @
5e7fbaef
...
...
@@ -694,6 +694,15 @@ def _test_ceil(data):
def
_test_floor
(
data
):
""" One iteration of floor """
return
_test_unary_elemwise
(
math_ops
.
floor
,
data
)
#######################################################################
# Round
# -----
def
_test_round
(
data
):
""" One iteration of round """
return
_test_unary_elemwise
(
math_ops
.
round
,
data
)
#######################################################################
# Exp
# ---
...
...
@@ -787,6 +796,7 @@ def test_all_unary_elemwise():
if
package_version
.
parse
(
tf
.
VERSION
)
>=
package_version
.
parse
(
'1.14.0'
):
_test_forward_unary_elemwise
(
_test_ceil
)
_test_forward_unary_elemwise
(
_test_cos
)
_test_forward_unary_elemwise
(
_test_round
)
_test_forward_unary_elemwise
(
_test_tan
)
_test_forward_unary_elemwise
(
_test_elu
)
...
...
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