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
41268947
"examples/model_compress/pruning/speedup/model_speedup.py" did not exist on "3ec26b40afd88b8255ebc74b46f475b77aa4d19b"
Commit
41268947
authored
Nov 03, 2022
by
charlie
Browse files
Add tests for coverage
parent
ed88834e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
test/op_shape_test.cpp
test/op_shape_test.cpp
+31
-0
test/shape_test.cpp
test/shape_test.cpp
+21
-0
No files found.
test/op_shape_test.cpp
View file @
41268947
...
@@ -1215,6 +1215,21 @@ TEST_CASE(multibroadcast_2in_static_dyn1)
...
@@ -1215,6 +1215,21 @@ TEST_CASE(multibroadcast_2in_static_dyn1)
a_shape
);
a_shape
);
}
}
TEST_CASE
(
multibroadcast_2in_static_dyn2
)
{
migraphx
::
shape
a_shape
{
migraphx
::
shape
::
float_type
,
{
1
,
6
}};
std
::
vector
<
migraphx
::
shape
::
dynamic_dimension
>
b
{{
8
,
8
,
0
},
{
6
,
6
,
0
}};
migraphx
::
shape
b_shape
{
migraphx
::
shape
::
float_type
,
b
};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
8
,
8
,
0
},
{
6
,
6
,
0
}}},
migraphx
::
make_op
(
"multibroadcast"
,
{{
"output_dyn_dims"
,
migraphx
::
to_value
(
b
)}}),
a_shape
,
b_shape
);
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
8
,
8
,
0
},
{
6
,
6
,
0
}}},
migraphx
::
make_op
(
"multibroadcast"
,
{{
"output_dyn_dims"
,
migraphx
::
to_value
(
b
)}}),
b_shape
,
a_shape
);
}
TEST_CASE
(
multibroadcast_2in_static_dyn_error0
)
TEST_CASE
(
multibroadcast_2in_static_dyn_error0
)
{
{
// doesn't match on first dimension
// doesn't match on first dimension
...
@@ -1261,6 +1276,22 @@ TEST_CASE(multibroadcast_2in_dyn_dyn0)
...
@@ -1261,6 +1276,22 @@ TEST_CASE(multibroadcast_2in_dyn_dyn0)
a_shape
);
a_shape
);
}
}
TEST_CASE
(
multibroadcast_2in_dyn_dyn1
)
{
std
::
vector
<
migraphx
::
shape
::
dynamic_dimension
>
a
{{
1
,
4
,
0
},
{
2
,
4
,
2
},
{
2
,
4
,
0
}};
migraphx
::
shape
a_shape
{
migraphx
::
shape
::
float_type
,
a
};
std
::
vector
<
migraphx
::
shape
::
dynamic_dimension
>
b
{{
2
,
4
,
2
},
{
2
,
4
,
0
}};
migraphx
::
shape
b_shape
{
migraphx
::
shape
::
float_type
,
b
};
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
2
,
4
,
2
},
{
2
,
4
,
0
}}},
migraphx
::
make_op
(
"multibroadcast"
,
{{
"output_dyn_dims"
,
migraphx
::
to_value
(
a
)}}),
a_shape
,
b_shape
);
expect_shape
(
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{{
1
,
4
,
0
},
{
2
,
4
,
2
},
{
2
,
4
,
0
}}},
migraphx
::
make_op
(
"multibroadcast"
,
{{
"output_dyn_dims"
,
migraphx
::
to_value
(
a
)}}),
b_shape
,
a_shape
);
}
TEST_CASE
(
multibroadcast_2in_dyn_dyn_error0
)
TEST_CASE
(
multibroadcast_2in_dyn_dyn_error0
)
{
{
// max doesn't match on second dimension of a
// max doesn't match on second dimension of a
...
...
test/shape_test.cpp
View file @
41268947
...
@@ -38,6 +38,27 @@ TEST_CASE(test_shape_default)
...
@@ -38,6 +38,27 @@ TEST_CASE(test_shape_default)
EXPECT
(
s
.
elements
()
==
0
);
EXPECT
(
s
.
elements
()
==
0
);
EXPECT
(
s
.
bytes
()
==
0
);
EXPECT
(
s
.
bytes
()
==
0
);
}
}
TEST_CASE
(
test_dyn_4arg_constructor
)
{
migraphx
::
shape
s
{
migraphx
::
shape
::
float_type
,
{
1
,
4
,
4
,
},
{
4
,
4
,
4
,
},
{
0
,
0
,
0
}};
std
::
vector
<
migraphx
::
shape
::
dynamic_dimension
>
expected_dyn_dims
=
{
{
1
,
4
,
0
},
{
4
,
4
,
0
},
{
4
,
4
,
0
}};
EXPECT
(
s
.
dynamic
());
EXPECT
(
s
.
dyn_dims
()
==
expected_dyn_dims
);
}
TEST_CASE
(
test_shape_assign
)
TEST_CASE
(
test_shape_assign
)
{
{
migraphx
::
shape
s1
{
migraphx
::
shape
::
float_type
,
{
100
,
32
,
8
,
8
}};
migraphx
::
shape
s1
{
migraphx
::
shape
::
float_type
,
{
100
,
32
,
8
,
8
}};
...
...
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