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
83181ddc
Commit
83181ddc
authored
Nov 09, 2021
by
Shucai Xiao
Browse files
clang format
parent
7cd27a5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
test/auto_contiguous_test.cpp
test/auto_contiguous_test.cpp
+14
-12
No files found.
test/auto_contiguous_test.cpp
View file @
83181ddc
...
...
@@ -103,14 +103,15 @@ TEST_CASE(after_param_broadcast)
TEST_CASE
(
two_transpose_gather
)
{
auto
create_module
=
[]
{
auto
create_module
=
[]
{
migraphx
::
module
m
;
auto
data
=
m
.
add_parameter
(
"2x2"
,
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
4
,
5
}});
auto
ind
=
m
.
add_parameter
(
"ind"
,
{
migraphx
::
shape
::
float_type
,
{
2
,
3
}});
auto
td
=
m
.
add_instruction
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
2
,
3
,
1
}}}),
data
);
auto
ind
=
m
.
add_parameter
(
"ind"
,
{
migraphx
::
shape
::
float_type
,
{
2
,
3
}});
auto
td
=
m
.
add_instruction
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
2
,
3
,
1
}}}),
data
);
auto
sd
=
m
.
add_instruction
(
migraphx
::
make_op
(
"softmax"
,
{{
"axis"
,
2
}}),
td
);
auto
bd
=
m
.
add_instruction
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
3
,
1
,
2
}}}),
sd
);
auto
bd
=
m
.
add_instruction
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
3
,
1
,
2
}}}),
sd
);
auto
r
=
m
.
add_instruction
(
migraphx
::
make_op
(
"gather"
,
{{
"axis"
,
2
}}),
bd
,
ind
);
m
.
add_return
({
r
});
...
...
@@ -120,17 +121,18 @@ TEST_CASE(two_transpose_gather)
auto
m
=
create_module
();
run_pass
(
m
);
auto
create_cont_module
=
[]
{
auto
create_cont_module
=
[]
{
migraphx
::
module
m
;
auto
data
=
m
.
add_parameter
(
"2x2"
,
{
migraphx
::
shape
::
float_type
,
{
2
,
3
,
4
,
5
}});
auto
ind
=
m
.
add_parameter
(
"ind"
,
{
migraphx
::
shape
::
float_type
,
{
2
,
3
}});
auto
td
=
m
.
add_instruction
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
2
,
3
,
1
}}}),
data
);
auto
ind
=
m
.
add_parameter
(
"ind"
,
{
migraphx
::
shape
::
float_type
,
{
2
,
3
}});
auto
td
=
m
.
add_instruction
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
2
,
3
,
1
}}}),
data
);
auto
ctd
=
m
.
add_instruction
(
migraphx
::
make_op
(
"contiguous"
),
td
);
auto
sd
=
m
.
add_instruction
(
migraphx
::
make_op
(
"softmax"
,
{{
"axis"
,
2
}}),
ctd
);
auto
bd
=
m
.
add_instruction
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
3
,
1
,
2
}}}),
sd
);
auto
sd
=
m
.
add_instruction
(
migraphx
::
make_op
(
"softmax"
,
{{
"axis"
,
2
}}),
ctd
);
auto
bd
=
m
.
add_instruction
(
migraphx
::
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
3
,
1
,
2
}}}),
sd
);
auto
cbd
=
m
.
add_instruction
(
migraphx
::
make_op
(
"contiguous"
),
bd
);
auto
r
=
m
.
add_instruction
(
migraphx
::
make_op
(
"gather"
,
{{
"axis"
,
2
}}),
cbd
,
ind
);
auto
r
=
m
.
add_instruction
(
migraphx
::
make_op
(
"gather"
,
{{
"axis"
,
2
}}),
cbd
,
ind
);
m
.
add_return
({
r
});
return
m
;
...
...
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