Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tvm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cld
ml
tvm
Commits
d7c600b8
Commit
d7c600b8
authored
6 years ago
by
Tianqi Chen
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[TOPI] Update parameter name of conv2d (#1380)
parent
30f09bea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
nnvm/python/nnvm/testing/darknet.py
+1
-1
1 addition, 1 deletion
nnvm/python/nnvm/testing/darknet.py
topi/python/topi/nn/conv2d.py
+7
-6
7 additions, 6 deletions
topi/python/topi/nn/conv2d.py
topi/python/topi/rasp/conv2d.py
+1
-4
1 addition, 4 deletions
topi/python/topi/rasp/conv2d.py
with
9 additions
and
11 deletions
nnvm/python/nnvm/testing/darknet.py
+
1
−
1
View file @
d7c600b8
...
...
@@ -9,8 +9,8 @@ These are utility functions used for testing and tutorial file.
from
__future__
import
division
import
math
import
numpy
as
np
import
cv2
from
cffi
import
FFI
import
cv2
def
_resize_image
(
img
,
w_in
,
h_in
):
"""
Resize the image to the given height and width.
"""
...
...
This diff is collapsed.
Click to expand it.
topi/python/topi/nn/conv2d.py
+
7
−
6
View file @
d7c600b8
# pylint: disable=invalid-name, unused-variable, too-many-locals, unused-argument
# pylint: disable=invalid-name, unused-variable, too-many-locals
# pylint: disable=unused-argument, redefined-builtin
"""
Conv2D operators
"""
from
__future__
import
absolute_import
as
_abs
from
collections
import
namedtuple
...
...
@@ -75,7 +76,7 @@ _WORKLOADS = [
_CONV_SCHEDULE
=
{}
@tvm.target.generic_func
def
conv2d
(
data
,
kernel
,
stride
,
padding
,
layout
=
'
NCHW
'
,
out_dtype
=
None
):
def
conv2d
(
input
,
filter
,
stride
s
,
padding
,
layout
=
'
NCHW
'
,
out_dtype
=
None
):
"""
Conv2D operator.
Parameters
...
...
@@ -86,7 +87,7 @@ def conv2d(data, kernel, stride, padding, layout='NCHW', out_dtype=None):
filter : tvm.Tensor
4-D with shape [num_filter, in_channel, filter_height, filter_width]
stride : int or a list/tuple of two ints
stride
s
: int or a list/tuple of two ints
stride size, or [stride_height, stride_width]
padding : int or a list/tuple of two ints
...
...
@@ -103,11 +104,11 @@ def conv2d(data, kernel, stride, padding, layout='NCHW', out_dtype=None):
# search platform specific declaration first
# default declaration
if
layout
==
'
NCHW
'
:
return
conv2d_nchw
(
data
,
kernel
,
stride
,
padding
,
out_dtype
)
return
conv2d_nchw
(
input
,
filter
,
stride
s
,
padding
,
out_dtype
)
elif
layout
==
'
HWCN
'
:
return
conv2d_hwcn
(
data
,
kernel
,
stride
,
padding
,
out_dtype
)
return
conv2d_hwcn
(
input
,
filter
,
stride
s
,
padding
,
out_dtype
)
elif
layout
==
'
NHWC
'
:
return
conv2d_nhwc
(
data
,
kernel
,
stride
,
padding
,
out_dtype
)
return
conv2d_nhwc
(
input
,
filter
,
stride
s
,
padding
,
out_dtype
)
else
:
raise
ValueError
(
"
not support this layout {} yet
"
.
format
(
layout
))
...
...
This diff is collapsed.
Click to expand it.
topi/python/topi/rasp/conv2d.py
+
1
−
4
View file @
d7c600b8
...
...
@@ -2,7 +2,6 @@
"""
Conv2D schedule on raspberry pi
"""
from
__future__
import
absolute_import
as
_abs
import
tvm
from
tvm
import
target
as
_target
from
..
import
tag
from
..nn.conv2d
import
conv2d
as
_conv2d
,
_get_schedule
from
..nn.conv2d
import
SpatialPack
,
Im2ColPack
...
...
@@ -201,9 +200,7 @@ def _schedule_im2col_conv2d(s, data, data_pad, data_col, data_vec,
else
:
stride
=
infer_stride
(
data_pad
,
kernel
,
output
)
wkl
=
_get_workload
(
data
,
kernel
,
stride
,
padding
,
output
.
dtype
)
with
_target
.
rasp
():
sch
=
_get_schedule
(
wkl
)
sch
=
_get_schedule
(
wkl
)
H
,
W
=
wkl
.
height
,
wkl
.
width
CI
=
wkl
.
in_filter
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment