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
54e1dfd1
Commit
54e1dfd1
authored
Jul 20, 2021
by
Khalique
Browse files
add standard shape test
parent
aa412fc5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
test/eliminate_contiguous_test.cpp
test/eliminate_contiguous_test.cpp
+14
-0
No files found.
test/eliminate_contiguous_test.cpp
View file @
54e1dfd1
...
@@ -145,4 +145,18 @@ TEST_CASE(non_standard_flatten_op)
...
@@ -145,4 +145,18 @@ TEST_CASE(non_standard_flatten_op)
EXPECT
(
std
::
distance
(
m
.
begin
(),
m
.
end
())
==
count
);
EXPECT
(
std
::
distance
(
m
.
begin
(),
m
.
end
())
==
count
);
}
}
TEST_CASE
(
standard_flatten_op
)
{
migraphx
::
module
m
;
auto
l
=
m
.
add_parameter
(
"x"
,
{
migraphx
::
shape
::
float_type
,
{
2
,
6
,
6
,
6
}});
auto
t
=
m
.
add_instruction
(
migraphx
::
make_op
(
"slice"
,
{{
"axes"
,
{
0
,
1
}},
{
"starts"
,
{
1
,
1
}},
{
"ends"
,
{
6
,
6
}}}),
l
);
auto
c
=
m
.
add_instruction
(
migraphx
::
make_op
(
"contiguous"
),
t
);
m
.
add_instruction
(
migraphx
::
make_op
(
"flatten"
),
c
);
auto
count
=
std
::
distance
(
m
.
begin
(),
m
.
end
());
run_pass
(
m
);
EXPECT
(
std
::
distance
(
m
.
begin
(),
m
.
end
())
==
(
count
-
1
));
}
int
main
(
int
argc
,
const
char
*
argv
[])
{
test
::
run
(
argc
,
argv
);
}
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