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
7ce6a41d
Commit
7ce6a41d
authored
Aug 03, 2019
by
Huilin Qu
Committed by
Tianqi Chen
Aug 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix gather_nd in Relay (#3442)
* Fix gather_nd in Relay * Add test cases for gather_nd.
parent
05c528c1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
src/relay/op/tensor/transform.cc
+1
-1
tests/python/frontend/mxnet/test_forward.py
+2
-0
tests/python/relay/test_op_level3.py
+2
-1
No files found.
src/relay/op/tensor/transform.cc
View file @
7ce6a41d
...
...
@@ -2332,7 +2332,7 @@ bool GatherNDRel(const Array<Type>& types,
return
false
;
}
const
size_t
ndim
=
data
->
shape
.
size
();
const
IntImm
*
mdim
=
data
->
shape
[
0
].
as
<
IntImm
>
();
const
IntImm
*
mdim
=
indices
->
shape
[
0
].
as
<
IntImm
>
();
const
size_t
kdim
=
indices
->
shape
.
size
()
-
1
;
CHECK
(
size_t
(
mdim
->
value
)
<=
ndim
)
<<
"GatherND: indices shape does satisfy."
;
...
...
tests/python/frontend/mxnet/test_forward.py
View file @
7ce6a41d
...
...
@@ -528,6 +528,8 @@ def test_forward_gather_nd():
tvm
.
testing
.
assert_allclose
(
op_res
.
asnumpy
(),
ref_res
.
asnumpy
())
verify
((
2
,
2
),
(
2
,
3
),
[[
1
,
1
,
0
],
[
0
,
1
,
0
]])
verify
((
2
,
2
,
2
),
(
2
,
2
),
[[
0
,
1
],
[
1
,
0
]])
verify
((
3
,
2
,
2
),
(
2
,
2
),
[[
0
,
1
],
[
1
,
0
]])
verify
((
3
,
2
),
(
2
,
2
,
3
),
[[[
0
,
1
,
2
],
[
2
,
0
,
1
]],
[[
0
,
0
,
0
],
[
1
,
1
,
1
]]])
def
test_forward_bilinear_resize
():
# add tests including scale_height and scale_width when mxnet is updated to version 1.5
...
...
tests/python/relay/test_op_level3.py
View file @
7ce6a41d
...
...
@@ -682,7 +682,8 @@ def test_gather_nd():
tvm
.
testing
.
assert_allclose
(
op_res
.
asnumpy
(),
ref_res
,
rtol
=
1e-5
)
verify_gather_nd
((
2
,
2
),
(
2
,
3
),
[[
1
,
1
,
0
],
[
0
,
1
,
0
]])
verify_gather_nd
((
2
,
2
,
2
),
(
2
,
2
),
[[
0
,
1
],
[
1
,
0
]])
verify_gather_nd
((
3
,
2
,
2
),
(
2
,
2
),
[[
0
,
1
],
[
1
,
0
]])
verify_gather_nd
((
3
,
2
),
(
2
,
2
,
3
),
[[[
0
,
1
,
2
],
[
2
,
0
,
1
]],
[[
0
,
0
,
0
],
[
1
,
1
,
1
]]])
if
__name__
==
"__main__"
:
test_arange
()
...
...
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