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
dd74a89a
Commit
dd74a89a
authored
Feb 15, 2023
by
charlie
Browse files
Add shape.any_of_dynamic() tests
parent
3f4ef63e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
test/shape_test.cpp
test/shape_test.cpp
+24
-0
No files found.
test/shape_test.cpp
View file @
dd74a89a
...
...
@@ -238,6 +238,30 @@ TEST_CASE(test_shape_dynamic_serialize)
EXPECT
(
s3
!=
s4
);
}
TEST_CASE
(
any_of_dynamic_true
)
{
std
::
vector
<
migraphx
::
shape
>
sub_shapes
=
{};
sub_shapes
.
push_back
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
},
{
4
,
4
}}});
sub_shapes
.
push_back
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
3
,
4
,
5
}});
migraphx
::
shape
s0
{
sub_shapes
};
EXPECT
(
s0
.
any_of_dynamic
());
sub_shapes
=
{};
sub_shapes
.
push_back
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
1
,
1
},
{
4
,
4
}}});
sub_shapes
.
push_back
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
3
,
4
,
5
}});
migraphx
::
shape
s1
{
sub_shapes
};
EXPECT
(
s1
.
any_of_dynamic
());
}
TEST_CASE
(
any_of_dynamic_false
)
{
std
::
vector
<
migraphx
::
shape
>
sub_shapes
=
{};
sub_shapes
.
push_back
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
4
}});
sub_shapes
.
push_back
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
3
,
4
,
5
}});
migraphx
::
shape
s
{
sub_shapes
};
EXPECT
(
not
s
.
any_of_dynamic
());
}
TEST_CASE
(
test_shape_packed
)
{
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
{
2
,
2
},
{
2
,
1
}};
...
...
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