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
69758ed1
Commit
69758ed1
authored
Mar 25, 2019
by
XiaolongMeng
Committed by
Tianqi Chen
Mar 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix prelu, now can use on 2d input and add one test (#2875)
parent
a7c90ee5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
2 deletions
+2
-2
topi/include/topi/nn.h
+0
-1
topi/python/topi/nn/elemwise.py
+1
-1
topi/tests/python/test_topi_relu.py
+1
-0
No files found.
topi/include/topi/nn.h
View file @
69758ed1
...
@@ -97,7 +97,6 @@ inline tvm::Tensor prelu(const tvm::Tensor &x,
...
@@ -97,7 +97,6 @@ inline tvm::Tensor prelu(const tvm::Tensor &x,
const
int
axis
=
1
,
const
int
axis
=
1
,
std
::
string
name
=
"tensor"
,
std
::
string
name
=
"tensor"
,
std
::
string
tag
=
kBroadcast
)
{
std
::
string
tag
=
kBroadcast
)
{
CHECK_EQ
(
4
,
x
->
shape
.
size
());
CHECK
((
size_t
)
axis
<
x
->
shape
.
size
())
<<
CHECK
((
size_t
)
axis
<
x
->
shape
.
size
())
<<
"Wrong axis ("
<<
axis
<<
")value. "
;
"Wrong axis ("
<<
axis
<<
")value. "
;
CHECK
(
topi
::
detail
::
GetConstInt
(
slope
->
shape
[
0
])
==
CHECK
(
topi
::
detail
::
GetConstInt
(
slope
->
shape
[
0
])
==
...
...
topi/python/topi/nn/elemwise.py
View file @
69758ed1
...
@@ -69,7 +69,7 @@ def prelu(x, slope, axis=1):
...
@@ -69,7 +69,7 @@ def prelu(x, slope, axis=1):
[http://arxiv.org/pdf/1502.01852v1.pdf]
[http://arxiv.org/pdf/1502.01852v1.pdf]
"""
"""
assert
len
(
x
.
shape
)
==
4
and
len
(
slope
.
shape
)
==
1
assert
len
(
slope
.
shape
)
==
1
assert
axis
<
len
(
x
.
shape
)
assert
axis
<
len
(
x
.
shape
)
assert
get_const_int
(
slope
.
shape
[
0
])
==
get_const_int
(
x
.
shape
[
axis
])
assert
get_const_int
(
slope
.
shape
[
0
])
==
get_const_int
(
x
.
shape
[
axis
])
...
...
topi/tests/python/test_topi_relu.py
View file @
69758ed1
...
@@ -83,6 +83,7 @@ def test_leaky_relu():
...
@@ -83,6 +83,7 @@ def test_leaky_relu():
def
test_prelu
():
def
test_prelu
():
verify_prelu
((
1
,
3
,
2
,
2
),
(
3
,),
1
,
(
3
,
1
,
1
))
verify_prelu
((
1
,
3
,
2
,
2
),
(
3
,),
1
,
(
3
,
1
,
1
))
verify_prelu
((
1
,
3
,
2
,
2
),
(
2
,),
2
,
(
2
,
1
))
verify_prelu
((
1
,
3
,
2
,
2
),
(
2
,),
2
,
(
2
,
1
))
verify_prelu
((
1
,
3
),
(
3
,),
1
,
(
3
,
))
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
test_schedule_big_array
()
test_schedule_big_array
()
...
...
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