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
18e0c3fb
Commit
18e0c3fb
authored
Jul 03, 2022
by
Paul
Browse files
Format
parent
9c6eab14
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
test/simplify_reshapes_test.cpp
test/simplify_reshapes_test.cpp
+9
-10
No files found.
test/simplify_reshapes_test.cpp
View file @
18e0c3fb
...
@@ -1122,7 +1122,7 @@ TEST_CASE(transpose_unsqueeze_concat)
...
@@ -1122,7 +1122,7 @@ TEST_CASE(transpose_unsqueeze_concat)
{
{
migraphx
::
module
m1
;
migraphx
::
module
m1
;
{
{
auto
l0
=
m1
.
add_parameter
(
"0"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
2
,
1
,
1
}});
auto
l0
=
m1
.
add_parameter
(
"0"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
2
,
1
,
1
}});
auto
lt0
=
auto
lt0
=
m1
.
add_instruction
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
2
,
3
,
1
}}}),
l0
);
m1
.
add_instruction
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
2
,
3
,
1
}}}),
l0
);
auto
l1
=
m1
.
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
2
,
1
,
1
}});
auto
l1
=
m1
.
add_parameter
(
"1"
,
migraphx
::
shape
{
migraphx
::
shape
::
float_type
,
{
1
,
2
,
1
,
1
}});
...
@@ -1135,15 +1135,14 @@ TEST_CASE(transpose_unsqueeze_concat)
...
@@ -1135,15 +1135,14 @@ TEST_CASE(transpose_unsqueeze_concat)
std
::
vector
<
migraphx
::
instruction_ref
>
unsqueezed_args
;
std
::
vector
<
migraphx
::
instruction_ref
>
unsqueezed_args
;
int64_t
axis
=
3
;
int64_t
axis
=
3
;
std
::
transform
(
args
.
begin
(),
std
::
transform
(
args
.
end
(),
args
.
begin
(),
std
::
back_inserter
(
unsqueezed_args
),
args
.
end
(),
[
&
](
migraphx
::
instruction_ref
arg
)
{
std
::
back_inserter
(
unsqueezed_args
),
return
m1
.
add_instruction
(
[
&
](
migraphx
::
instruction_ref
arg
)
{
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
axis
}}}),
arg
);
return
m1
.
add_instruction
(
migraphx
::
make_op
(
"unsqueeze"
,
{{
"axes"
,
{
axis
}}}),
arg
);
});
});
m1
.
add_instruction
(
migraphx
::
make_op
(
"concat"
,
{{
"axis"
,
axis
}}),
m1
.
add_instruction
(
migraphx
::
make_op
(
"concat"
,
{{
"axis"
,
axis
}}),
unsqueezed_args
);
unsqueezed_args
);
}
}
// TODO: This could be simplified to a single transpose after concat
// TODO: This could be simplified to a single transpose after concat
migraphx
::
module
m2
=
m1
;
migraphx
::
module
m2
=
m1
;
...
...
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