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
856a40c1
Commit
856a40c1
authored
Dec 05, 2018
by
Khalique
Browse files
added reshape tests
parent
eb3a5886
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+16
-0
test/onnx/reshape_test.onnx
test/onnx/reshape_test.onnx
+24
-0
No files found.
test/onnx/onnx_test.cpp
View file @
856a40c1
...
@@ -350,6 +350,21 @@ void softmax_test()
...
@@ -350,6 +350,21 @@ void softmax_test()
EXPECT
(
p
==
prog
);
EXPECT
(
p
==
prog
);
}
}
void
reshape_test
()
{
migraphx
::
program
p
;
migraphx
::
op
::
reshape
op
;
std
::
vector
<
int64_t
>
reshape_dims
{
3
,
8
};
auto
l0
=
p
.
add_parameter
(
"0"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
4
,
2
,
3
}});
p
.
add_literal
(
migraphx
::
literal
{
migraphx
::
shape
{
migraphx
::
shape
::
int64_type
,
{
2
}},
reshape_dims
});
op
.
dims
=
reshape_dims
;
p
.
add_instruction
(
op
,
l0
);
p
.
add_instruction
(
op
,
l0
);
auto
prog
=
migraphx
::
parse_onnx
(
"reshape_test.onnx"
);
EXPECT
(
p
==
prog
);
}
int
main
()
int
main
()
{
{
pytorch_conv_bias_test
();
pytorch_conv_bias_test
();
...
@@ -377,4 +392,5 @@ int main()
...
@@ -377,4 +392,5 @@ int main()
add_bcast_test
();
add_bcast_test
();
implicit_bcast_test
();
implicit_bcast_test
();
unknown_test
();
unknown_test
();
reshape_test
();
}
}
test/onnx/reshape_test.onnx
0 → 100644
View file @
856a40c1
reshape-example:
0
12"Reshape
03"Reshape*
shape@@test-reshape*:B1Z
0
Z
1
b
2
b
3
B
\ No newline at end of file
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