Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
4e4460dd
Commit
4e4460dd
authored
Aug 02, 2018
by
Scott Thornton
Browse files
Added test for parsing batchnorm ONNX
parent
3a2469f4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+24
-0
No files found.
test/onnx/onnx_test.cpp
View file @
4e4460dd
...
...
@@ -39,6 +39,29 @@ void pytorch_conv_relu_maxpool()
EXPECT
(
p
==
prog
);
}
void
pytorch_conv_bn_relu_maxpool
()
{
migraph
::
program
p
;
auto
l0
=
p
.
add_parameter
(
"0"
,
{
migraph
::
shape
::
float_type
,
{
1
,
3
,
32
,
32
}});
auto
l1
=
p
.
add_parameter
(
"1"
,
{
migraph
::
shape
::
float_type
,
{
1
,
3
,
5
,
5
}});
auto
l2
=
p
.
add_parameter
(
"2"
,
{
migraph
::
shape
::
float_type
,
{
1
}});
auto
p3
=
p
.
add_parameter
(
"3"
,
{
migraph
::
shape
::
float_type
,
{
1
}});
auto
p4
=
p
.
add_parameter
(
"4"
,
{
migraph
::
shape
::
float_type
,
{
1
}});
auto
p5
=
p
.
add_parameter
(
"5"
,
{
migraph
::
shape
::
float_type
,
{
1
}});
auto
p6
=
p
.
add_parameter
(
"6"
,
{
migraph
::
shape
::
float_type
,
{
1
}});
uint64_t
axis
=
1
;
auto
l3
=
p
.
add_instruction
(
migraph
::
convolution
{},
l0
,
l1
);
auto
l4
=
p
.
add_instruction
(
migraph
::
broadcast
{
axis
},
l3
,
l2
);
auto
l5
=
p
.
add_instruction
(
migraph
::
add
{},
l3
,
l4
);
auto
l6
=
p
.
add_instruction
(
migraph
::
batch_norm_inference
{},
l5
,
p3
,
p4
,
p5
,
p6
);
auto
l7
=
p
.
add_instruction
(
migraph
::
activation
{
"relu"
},
l6
);
p
.
add_instruction
(
migraph
::
pooling
{
"max"
,
{{
0
,
0
}},
{{
2
,
2
}},
{{
2
,
2
}}},
l7
);
auto
prog
=
migraph
::
parse_onnx
(
"conv_bn_relu_maxpool.onnx"
);
EXPECT
(
p
==
prog
);
}
void
pytorch_conv_relu_maxpoolX2
()
{
migraph
::
program
p
;
...
...
@@ -69,5 +92,6 @@ int main()
{
pytorch_conv_bias_test
();
pytorch_conv_relu_maxpool
();
pytorch_conv_bn_relu_maxpool
();
pytorch_conv_relu_maxpoolX2
();
}
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