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
f5d158b7
Commit
f5d158b7
authored
Oct 26, 2017
by
tqchen
Committed by
Tianqi Chen
May 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TOP] Support ceil_mode
parent
67820feb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
nnvm/python/nnvm/top/nn.py
+4
-4
nnvm/tests/python/compiler/test_top_level2.py
+2
-1
No files found.
nnvm/python/nnvm/top/nn.py
View file @
f5d158b7
...
...
@@ -136,8 +136,8 @@ def compute_max_pool2d(attrs, inputs, _):
layout
=
attrs
[
"layout"
]
ceil_mode
=
attrs
.
get_bool
(
"ceil_mode"
)
assert
layout
==
"NCHW"
,
"only support nchw for now"
assert
not
ceil_mode
,
"not support ceil_mode now"
return
topi
.
nn
.
pool
(
inputs
[
0
],
pool_size
,
strides
,
padding
,
pool_type
=
'max'
)
return
topi
.
nn
.
pool
(
inputs
[
0
],
pool_size
,
strides
,
padding
,
pool_type
=
'max'
,
ceil_mode
=
ceil_mode
)
@reg.register_schedule
(
"max_pool2d"
)
def
schedule_max_pool2d
(
_
,
outs
,
target
):
...
...
@@ -158,8 +158,8 @@ def compute_avg_pool2d(attrs, inputs, _):
layout
=
attrs
[
"layout"
]
ceil_mode
=
attrs
.
get_bool
(
"ceil_mode"
)
assert
layout
==
"NCHW"
,
"only support nchw for now"
assert
not
ceil_mode
,
"not support ceil_mode now"
return
topi
.
nn
.
pool
(
inputs
[
0
],
pool_size
,
strides
,
padding
,
pool_type
=
'avg'
)
return
topi
.
nn
.
pool
(
inputs
[
0
],
pool_size
,
strides
,
padding
,
pool_type
=
'avg'
,
ceil_mode
=
ceil_mode
)
@reg.register_schedule
(
"avg_pool2d"
)
def
schedule_avg_pool2d
(
_
,
outs
,
target
):
...
...
nnvm/tests/python/compiler/test_top_level2.py
View file @
f5d158b7
...
...
@@ -56,7 +56,8 @@ def test_grouped_conv2d():
def
test_max_pool2d
():
x
=
sym
.
Variable
(
"x"
)
y
=
sym
.
max_pool2d
(
x
,
pool_size
=
(
2
,
2
),
strides
=
(
2
,
2
),
padding
=
(
0
,
0
),
name
=
"y"
)
y
=
sym
.
max_pool2d
(
x
,
pool_size
=
(
2
,
2
),
strides
=
(
2
,
2
),
padding
=
(
0
,
0
),
name
=
"y"
,
ceil_mode
=
True
)
dtype
=
"float32"
dshape
=
(
1
,
3
,
28
,
28
)
oshape
=
(
1
,
3
,
14
,
14
)
...
...
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