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
45867925
Commit
45867925
authored
Jan 16, 2019
by
Shucai Xiao
Browse files
Add two more test for shape, constant, gather.
parent
04b3214a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+15
-0
test/onnx/shape_gather.onnx
test/onnx/shape_gather.onnx
+0
-0
No files found.
test/onnx/onnx_test.cpp
View file @
45867925
...
...
@@ -424,6 +424,21 @@ TEST_CASE(gather_test)
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
shape_gather_test
)
{
migraphx
::
program
p
;
auto
l0
=
p
.
add_parameter
(
"x"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
7
,
3
,
10
}});
auto
l1
=
p
.
add_literal
(
migraphx
::
shape
{
migraphx
::
shape
::
int64_type
,
{
3
}},
l0
->
get_shape
().
lens
());
migraphx
::
shape
const_shape
{
migraphx
::
shape
::
int32_type
,
{
1
}};
auto
l2
=
p
.
add_literal
(
migraphx
::
literal
{
const_shape
,
{
1
}});
std
::
size_t
axis
=
0
;
p
.
add_instruction
(
migraphx
::
op
::
gather
{
axis
},
l1
,
l2
);
auto
prog
=
migraphx
::
parse_onnx
(
"shape_gather.onnx"
);
EXPECT
(
p
==
prog
);
}
TEST_CASE
(
flatten_test
)
{
migraphx
::
program
p
;
...
...
test/onnx/shape_gather.onnx
0 → 100644
View file @
45867925
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