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
094fc680
Commit
094fc680
authored
May 05, 2019
by
Yong Wu
Committed by
Yizhi Liu
May 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Relay][Frontend] add log op in tf frontend (#3111)
* [Relay][Frontend] add log op in tf frontend * address comment
parent
88daa2bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
python/tvm/relay/frontend/tensorflow.py
+4
-2
tests/python/frontend/tensorflow/test_forward.py
+19
-0
No files found.
python/tvm/relay/frontend/tensorflow.py
View file @
094fc680
...
...
@@ -1094,6 +1094,7 @@ _convert_map = {
'ArgMin'
:
_argx
(
_op
.
argmin
,
'argmin'
),
'AvgPool'
:
_pooling
(
'avg_pool'
),
'BatchNormWithGlobalNormalization'
:
_batch_norm
(),
'BatchToSpaceND'
:
_batch_to_space_nd
(),
'BiasAdd'
:
_bias_add
(),
'Cast'
:
_cast
(),
'Ceil'
:
AttrCvt
(
'ceil'
),
...
...
@@ -1119,6 +1120,7 @@ _convert_map = {
'LeakyRelu'
:
AttrCvt
(
'leaky_relu'
),
'Less'
:
_broadcast
(
'less'
),
'LessEqual'
:
_broadcast
(
'less_equal'
),
'Log'
:
AttrCvt
(
'log'
),
'LogicalAnd'
:
_logical
(
'logical_and'
),
'LogicalOr'
:
_logical
(
'logical_or'
),
'LogicalNot'
:
_logical
(
'logical_not'
),
...
...
@@ -1151,6 +1153,7 @@ _convert_map = {
'Sign'
:
AttrCvt
(
'sign'
),
'Slice'
:
_slice
(),
'Softmax'
:
_softmax
(),
'SpaceToBatchND'
:
_space_to_batch_nd
(),
'Split'
:
_split
(
False
),
'SplitV'
:
_split
(
True
),
'Square'
:
_square
(),
...
...
@@ -1162,8 +1165,7 @@ _convert_map = {
'Tile'
:
_tile
(),
'Transpose'
:
_transpose
(),
'Unpack'
:
_unpack
(),
'SpaceToBatchND'
:
_space_to_batch_nd
(),
'BatchToSpaceND'
:
_batch_to_space_nd
(),
}
def
_LSTMBlockCell
():
...
...
tests/python/frontend/tensorflow/test_forward.py
View file @
094fc680
...
...
@@ -1440,6 +1440,23 @@ def test_forward_pow_exp():
compare_tf_with_tvm
([
np_in1
,
np_in2
],
[
'in1:0'
,
'in2:0'
],
'pow:0'
)
compare_tf_with_tvm
([
np_in1
],
[
'in1:0'
],
'exp:0'
)
def
test_forward_log
():
"""test Log """
np_data
=
np
.
random
.
uniform
(
1
,
100
,
size
=
(
2
,
3
,
5
))
.
astype
(
np
.
float32
)
tf
.
reset_default_graph
()
in_data
=
tf
.
placeholder
(
tf
.
float32
,
(
2
,
3
,
5
),
name
=
"in_data"
)
tf
.
log
(
in_data
,
name
=
"log"
)
compare_tf_with_tvm
([
np_data
],
[
'in_data:0'
],
'log:0'
)
def
test_forward_rsqrt
():
"""test Rsqrt """
np_data
=
np
.
random
.
uniform
(
1
,
100
,
size
=
(
5
,
7
,
11
))
.
astype
(
np
.
float32
)
tf
.
reset_default_graph
()
in_data
=
tf
.
placeholder
(
tf
.
float32
,
(
5
,
7
,
11
),
name
=
"in_data"
)
tf
.
rsqrt
(
in_data
,
name
=
"rsqrt"
)
print
(
tf
.
get_default_graph
()
.
as_graph_def
())
compare_tf_with_tvm
([
np_data
],
[
'in_data:0'
],
'rsqrt:0'
)
#######################################################################
# Mean
# ----
...
...
@@ -1525,6 +1542,8 @@ if __name__ == '__main__':
test_forward_reverse_v2
()
test_forward_pow_exp
()
test_forward_sign
()
test_forward_log
()
test_forward_rsqrt
()
test_forward_expand_dims
()
# Reductions
...
...
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