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
079e2307
Commit
079e2307
authored
Jan 20, 2018
by
masahi
Committed by
Tianqi Chen
Jan 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify expr in get_const_tuple (#795)
* fix upsampling output shape * simplify expr in get_const_tuple
parent
ebf4e5a3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
topi/python/topi/nn/upsampling.py
+3
-2
topi/python/topi/util.py
+2
-3
No files found.
topi/python/topi/nn/upsampling.py
View file @
079e2307
"""TVM operator upsampling compute."""
from
__future__
import
absolute_import
import
tvm
from
..
import
util
def
upsampling
(
data
,
scale
):
...
...
@@ -21,8 +22,8 @@ def upsampling(data, scale):
4-D with shape [batch, channel, in_height*scale, in_width*scale]
"""
batch
,
channel
,
height
,
width
=
data
.
shape
out_height
=
height
*
scale
out_width
=
width
*
scale
out_height
=
util
.
simplify
(
height
*
scale
)
out_width
=
util
.
simplify
(
width
*
scale
)
return
tvm
.
compute
((
batch
,
channel
,
out_height
,
out_width
),
\
lambda
n
,
c
,
h
,
w
:
data
[
n
,
c
,
h
/
scale
,
w
/
scale
])
topi/python/topi/util.py
View file @
079e2307
...
...
@@ -59,9 +59,8 @@ def get_const_tuple(in_tuple):
"""
out_tuple
=
()
for
elem
in
in_tuple
:
if
not
isinstance
(
elem
,
(
tvm
.
expr
.
IntImm
,
tvm
.
expr
.
UIntImm
)):
raise
ValueError
(
"Element of input tuple should be const int"
)
out_tuple
=
out_tuple
+
(
elem
.
value
,
)
value
=
get_const_int
(
elem
)
out_tuple
=
out_tuple
+
(
value
,
)
return
out_tuple
...
...
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