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
01753a1b
Commit
01753a1b
authored
Nov 02, 2022
by
Khalique Ahmed
Browse files
add extra layout test
parent
8f66211c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
test/layout_nhwc.cpp
test/layout_nhwc.cpp
+35
-0
No files found.
test/layout_nhwc.cpp
View file @
01753a1b
...
...
@@ -124,4 +124,39 @@ TEST_CASE(conv_add)
EXPECT
(
m1
.
sort
()
==
m2
.
sort
());
}
TEST_CASE
(
conv_conv
)
{
migraphx
::
module
m1
;
{
auto
x
=
m1
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
8
,
16
,
16
}});
auto
w
=
m1
.
add_literal
(
migraphx
::
generate_literal
({
migraphx
::
shape
::
float_type
,
{
8
,
8
,
1
,
1
}}));
auto
conv1
=
m1
.
add_instruction
(
migraphx
::
make_op
(
"convolution"
),
x
,
w
);
m1
.
add_instruction
(
migraphx
::
make_op
(
"convolution"
),
conv1
,
w
);
}
run_pass
(
m1
);
migraphx
::
module
m2
;
{
auto
x
=
add_layout_nhwc
(
m2
,
m2
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
8
,
16
,
16
}}));
auto
w
=
m2
.
add_literal
(
migraphx
::
generate_literal
(
{
migraphx
::
shape
::
float_type
,
{
8
,
8
,
1
,
1
}}));
auto
conv
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"convolution"
),
x
,
add_layout_nhwc
(
m2
,
w
));
auto
conv_layout
=
m2
.
add_instruction
(
migraphx
::
make_op
(
"convolution"
),
conv
,
add_layout_nhwc
(
m2
,
w
));
m2
.
add_instruction
(
layout
(),
conv_layout
);
}
EXPECT
(
m1
.
sort
()
==
m2
.
sort
());
}
int
main
(
int
argc
,
const
char
*
argv
[])
{
test
::
run
(
argc
,
argv
);
}
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