Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
20a8a693
Commit
20a8a693
authored
Aug 16, 2019
by
Shucai Xiao
Browse files
add a unit test for better code coverage
parent
6a04a953
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+16
-0
test/onnx/transpose_gather.onnx
test/onnx/transpose_gather.onnx
+0
-0
No files found.
test/onnx/onnx_test.cpp
View file @
20a8a693
...
@@ -509,6 +509,22 @@ TEST_CASE(shape_gather_test)
...
@@ -509,6 +509,22 @@ TEST_CASE(shape_gather_test)
EXPECT
(
p
==
prog
);
EXPECT
(
p
==
prog
);
}
}
TEST_CASE
(
transpose_gather_test
)
{
migraphx
::
program
p
;
auto
data
=
p
.
add_parameter
(
"data"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
3
,
5
,
4
,
6
}});
auto
ind
=
p
.
add_parameter
(
"indices"
,
migraphx
::
shape
{
migraphx
::
shape
::
int32_type
,
{
2
,
4
,
3
,
5
}});
auto
tr_data
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
0
,
2
,
1
,
3
}},
data
);
auto
tr_ind
=
p
.
add_instruction
(
migraphx
::
op
::
transpose
{{
0
,
2
,
1
,
3
}},
ind
);
auto
std_data
=
p
.
add_instruction
(
migraphx
::
op
::
contiguous
{},
tr_data
);
auto
std_ind
=
p
.
add_instruction
(
migraphx
::
op
::
contiguous
{},
tr_ind
);
int
axis
=
1
;
p
.
add_instruction
(
migraphx
::
op
::
gather
{
axis
},
std_data
,
std_ind
);
auto
prog
=
migraphx
::
parse_onnx
(
"transpose_gather.onnx"
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
flatten_test
)
TEST_CASE
(
flatten_test
)
{
{
migraphx
::
program
p
;
migraphx
::
program
p
;
...
...
test/onnx/transpose_gather.onnx
0 → 100644
View file @
20a8a693
File added
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