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
d184d2f8
Commit
d184d2f8
authored
Nov 12, 2019
by
Neo Chien
Committed by
Zhi
Nov 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Relay][Frontend][Tensorflow] Fix type assignment for operator 'tf.range' (#4294)
parent
62521453
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
python/tvm/relay/frontend/tensorflow.py
+4
-2
tests/python/frontend/tensorflow/test_forward.py
+5
-0
No files found.
python/tvm/relay/frontend/tensorflow.py
View file @
d184d2f8
...
...
@@ -1075,6 +1075,7 @@ def _rank():
return
_impl
def
_range
():
def
_impl
(
inputs
,
attr
,
params
):
start
=
_get_param
(
params
,
inputs
[
0
])[
0
]
...
...
@@ -1082,7 +1083,7 @@ def _range():
if
hasattr
(
inputs
[
1
],
"name_hint"
)
or
isinstance
(
inputs
[
1
],
_expr
.
Constant
)
\
else
params
.
pop
(
'Rank'
)
.
asnumpy
()[
0
]
delta
=
_get_param
(
params
,
inputs
[
2
])[
0
]
dtype
=
attr
[
'
dtype'
]
.
name
if
'dtype'
in
attr
else
"int32"
dtype
=
attr
[
'
Tidx'
]
.
name
if
'Tidx'
in
attr
else
str
(
start
.
dtype
)
return
AttrCvt
(
op_name
=
"arange"
,
ignores
=
[
'Tidx'
],
...
...
@@ -1092,6 +1093,7 @@ def _range():
'dtype'
:
dtype
})([],
attr
)
return
_impl
def
_elu
():
def
_impl
(
inputs
,
attr
,
params
):
dtype
=
attr
[
'T'
]
.
name
...
...
@@ -1202,7 +1204,7 @@ def _topk():
raise
tvm
.
error
.
OpAttributeInvalid
(
'Attribute k must be positive in operator TopKV2'
)
if
attr
[
'sorted'
]
is
False
:
raise
tvm
.
error
.
OpAttributeUn
i
mplemented
(
raise
tvm
.
error
.
OpAttributeUn
I
mplemented
(
'Attribute sorted=False is not supported in operator TopKV2'
)
return
AttrCvt
(
op_name
=
'topk'
,
ignores
=
[
'sorted'
],
...
...
tests/python/frontend/tensorflow/test_forward.py
View file @
d184d2f8
...
...
@@ -1638,6 +1638,11 @@ def test_forward_range():
tf
.
range
(
1
,
18
,
3
,
name
=
"range"
)
compare_tf_with_tvm
([],
[],
'range:0'
)
"""test type assignment for operator Range"""
tf
.
reset_default_graph
()
tf
.
range
(
1
,
256
+
1
,
1
,
dtype
=
tf
.
float32
)
compare_tf_with_tvm
([],
[],
'range:0'
)
#######################################################################
# Pad
# ---
...
...
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