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
2a7f7548
Commit
2a7f7548
authored
Apr 19, 2019
by
Balint Cristian
Committed by
Tianqi Chen
Apr 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Additional fix for PR#2972 (#3044)
parent
4ab97dfa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
11 deletions
+10
-11
topi/python/topi/arm_cpu/conv2d.py
+1
-1
topi/python/topi/cuda/conv2d_winograd.py
+1
-1
topi/python/topi/intel_graphics/conv2d.py
+2
-3
topi/python/topi/x86/conv2d.py
+6
-6
No files found.
topi/python/topi/arm_cpu/conv2d.py
View file @
2a7f7548
...
...
@@ -700,7 +700,7 @@ def _alter_conv2d_layout_arm(attrs, inputs, tinfos, F):
new_attrs
=
{
k
:
attrs
[
k
]
for
k
in
attrs
.
keys
()}
if
F
==
tvm
.
relay
.
op
:
if
F
.
__name__
==
'tvm.relay.op'
:
# Derive channels for frontends (e.g ONNX) that miss "channel" field.
new_attrs
[
"channels"
]
=
inputs
[
1
]
.
checked_type
.
shape
[
attrs
[
'kernel_layout'
]
.
index
(
'O'
)]
...
...
topi/python/topi/cuda/conv2d_winograd.py
View file @
2a7f7548
...
...
@@ -371,7 +371,7 @@ def _alter_conv2d_layout(attrs, inputs, tinfos, F):
copy_inputs
=
[
s
for
s
in
inputs
]
new_attrs
=
{
k
:
attrs
[
k
]
for
k
in
attrs
.
keys
()}
if
F
==
tvm
.
relay
.
op
:
if
F
.
__name__
==
'tvm.relay.op'
:
# Derive channels for frontends (e.g ONNX) that miss "channel" field.
new_attrs
[
"channels"
]
=
inputs
[
1
]
.
checked_type
.
shape
[
attrs
[
'kernel_layout'
]
.
index
(
'O'
)]
...
...
topi/python/topi/intel_graphics/conv2d.py
View file @
2a7f7548
...
...
@@ -54,7 +54,6 @@ def tile_and_bind3d(s, tensor, z, y, x, z_factor=2, y_factor=None, x_factor=None
@conv2d_alter_layout.register
([
"intel_graphics"
])
def
_alter_conv2d_layout
(
attrs
,
inputs
,
tinfos
,
F
):
import
nnvm.symbol
as
sym
copy_inputs
=
[
s
for
s
in
inputs
]
...
...
@@ -75,11 +74,11 @@ def _alter_conv2d_layout(attrs, inputs, tinfos, F):
new_attrs
=
{
k
:
attrs
[
k
]
for
k
in
attrs
.
keys
()}
new_attrs
[
"kernel_layout"
]
=
'OIHW
%
do'
%
(
oc_bn
)
if
F
==
tvm
.
relay
.
op
:
if
F
.
__name__
==
'tvm.relay.op'
:
# Derive channels for frontends (e.g ONNX) that miss "channel" field.
new_attrs
[
"channels"
]
=
inputs
[
1
]
.
checked_type
.
shape
[
attrs
[
'kernel_layout'
]
.
index
(
'O'
)]
if
F
==
sym
:
if
F
.
__name__
==
'nnvm.symbol'
:
out
=
F
.
contrib
.
conv2d_NCHWc
(
*
copy_inputs
,
**
new_attrs
)
else
:
out
=
F
.
nn
.
contrib_conv2d_nchwc
(
*
copy_inputs
,
**
new_attrs
)
...
...
topi/python/topi/x86/conv2d.py
View file @
2a7f7548
...
...
@@ -323,12 +323,11 @@ def _topi_nn_conv2d_NCHWc(*args, **kwargs):
@conv2d_alter_layout.register
(
"cpu"
)
def
_alter_conv2d_layout
(
attrs
,
inputs
,
tinfo
,
F
):
import
nnvm.symbol
as
sym
copy_inputs
=
[
s
for
s
in
inputs
]
new_attrs
=
{
k
:
attrs
[
k
]
for
k
in
attrs
.
keys
()}
if
F
==
tvm
.
relay
.
op
:
if
F
.
__name__
==
'tvm.relay.op'
:
# Derive channels for frontends (e.g ONNX) that miss "channel" field.
new_attrs
[
"channels"
]
=
inputs
[
1
]
.
checked_type
.
shape
[
attrs
[
'kernel_layout'
]
.
index
(
'O'
)]
...
...
@@ -336,13 +335,14 @@ def _alter_conv2d_layout(attrs, inputs, tinfo, F):
batch_size
,
in_channel
,
height
,
width
=
get_const_tuple
(
data
.
shape
)
groups
=
attrs
.
get_int
(
"groups"
)
out_channel
=
attrs
.
get_int
(
"channels"
)
if
F
==
sym
else
new_attrs
[
"channels"
]
out_channel
=
attrs
.
get_int
(
"channels"
)
\
if
F
.
__name__
==
'nnvm.symbol'
else
new_attrs
[
"channels"
]
padding
=
attrs
.
get_int_tuple
(
"padding"
)
strides
=
attrs
.
get_int_tuple
(
"strides"
)
dilation
=
attrs
.
get_int_tuple
(
"dilation"
)
out_dtype
=
attrs
[
"out_dtype"
]
layout_name
=
'layout'
if
F
==
sym
else
'data_layout'
layout_name
=
'layout'
if
F
.
__name__
==
'nnvm.symbol'
else
'data_layout'
layout
=
attrs
[
layout_name
]
kh
,
kw
=
attrs
.
get_int_tuple
(
"kernel_size"
)
...
...
@@ -399,12 +399,12 @@ def _alter_conv2d_layout(attrs, inputs, tinfo, F):
dispatch_ctx
.
update
(
target
,
new_workload
,
cfg
)
if
is_depthwise
:
if
F
==
sym
:
if
F
.
__name__
==
'nnvm.symbol'
:
logging
.
warning
(
"Use native layout for depthwise convolution on NNVM."
)
return
None
return
F
.
nn
.
contrib_depthwise_conv2d_nchwc
(
*
copy_inputs
,
**
new_attrs
)
else
:
if
F
==
sym
:
if
F
.
__name__
==
'nnvm.symbol'
:
return
F
.
contrib
.
conv2d_NCHWc
(
*
copy_inputs
,
**
new_attrs
)
return
F
.
nn
.
contrib_conv2d_nchwc
(
*
copy_inputs
,
**
new_attrs
)
...
...
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