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
1e9d014b
Commit
1e9d014b
authored
Jun 27, 2019
by
Altan Haan
Committed by
Tianqi Chen
Jun 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Relay] Fix reduce axis bug (#3422)
* fix relay reduce axis bug * add tests for reduce bug
parent
7db5779f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
python/tvm/relay/op/reduce.py
+2
-2
tests/python/relay/test_op_level4.py
+2
-0
No files found.
python/tvm/relay/op/reduce.py
View file @
1e9d014b
...
...
@@ -107,7 +107,7 @@ def sum(data, axis=None, keepdims=False, exclude=False):
result : relay.Expr
The computed result.
"""
axis
=
[
axis
]
if
axis
and
isinstance
(
axis
,
int
)
else
axis
axis
=
[
axis
]
if
isinstance
(
axis
,
int
)
else
axis
return
_make
.
sum
(
data
,
axis
,
keepdims
,
exclude
)
...
...
@@ -159,7 +159,7 @@ def all(data, axis=None, keepdims=False, exclude=False):
# [False, True, False]]
"""
axis
=
[
axis
]
if
axis
and
isinstance
(
axis
,
int
)
else
axis
axis
=
[
axis
]
if
isinstance
(
axis
,
int
)
else
axis
return
_make
.
all
(
data
,
axis
,
keepdims
,
exclude
)
...
...
tests/python/relay/test_op_level4.py
View file @
1e9d014b
...
...
@@ -202,7 +202,9 @@ def test_reduce_functions():
[
relay
.
argmax
,
_with_keepdims
(
np
.
argmax
)]]:
verify_reduce
(
func
,
(
d1
,
d2
,
d3
,
d4
),
None
,
False
,
False
,
())
verify_reduce
(
func
,
(
d1
,
d2
,
d3
,
d4
),
2
,
True
,
False
,
(
d1
,
d2
,
1
,
d4
))
verify_reduce
(
func
,
(
d1
,
d2
,
d3
,
d4
),
0
,
True
,
False
,
(
1
,
d2
,
d3
,
d4
))
verify_reduce
(
func
,
(
d1
,
d2
,
d3
),
1
,
True
,
False
,
(
d1
,
1
,
d3
))
verify_reduce
(
func
,
(
d1
,
d2
,
d3
),
0
,
True
,
False
,
(
1
,
d2
,
d3
))
verify_reduce
(
func
,
(
d1
,
d2
,
d3
),
None
,
True
,
False
,
(
1
,
1
,
1
))
verify_reduce
(
func
,
(
d1
,
d2
,
d3
),
(
0
,
1
),
True
,
False
,
(
1
,
1
,
d3
))
verify_reduce
(
func
,
(
2
,
3
,
4
),
1
,
True
,
False
,
(
2
,
1
,
4
))
...
...
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