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
5e22d800
"ts/webui/src/static/model/localStorage.ts" did not exist on "b22f192c8c9e81eb0e8a5c1108c2a55f9a51ea46"
Commit
5e22d800
authored
Oct 26, 2022
by
Khalique Ahmed
Browse files
formatting
parent
69178b49
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
src/rewrite_gemm.cpp
src/rewrite_gemm.cpp
+13
-9
No files found.
src/rewrite_gemm.cpp
View file @
5e22d800
...
@@ -57,9 +57,11 @@ void rewrite_gemm::apply(module& m) const
...
@@ -57,9 +57,11 @@ void rewrite_gemm::apply(module& m) const
if
(
in_size
<
4
)
if
(
in_size
<
4
)
{
{
std
::
vector
<
size_t
>
new_lens0
(
in0
->
get_shape
().
lens
().
begin
(),
in0
->
get_shape
().
lens
().
end
());
std
::
vector
<
size_t
>
new_lens0
(
in0
->
get_shape
().
lens
().
begin
(),
std
::
vector
<
size_t
>
new_lens1
(
in1
->
get_shape
().
lens
().
begin
(),
in1
->
get_shape
().
lens
().
end
());
in0
->
get_shape
().
lens
().
end
());
std
::
vector
<
size_t
>
ones
(
4
-
in_size
,
1
);
std
::
vector
<
size_t
>
new_lens1
(
in1
->
get_shape
().
lens
().
begin
(),
in1
->
get_shape
().
lens
().
end
());
std
::
vector
<
size_t
>
ones
(
4
-
in_size
,
1
);
new_lens0
.
insert
(
new_lens0
.
begin
(),
ones
.
begin
(),
ones
.
end
());
new_lens0
.
insert
(
new_lens0
.
begin
(),
ones
.
begin
(),
ones
.
end
());
new_lens1
.
insert
(
new_lens1
.
begin
(),
ones
.
begin
(),
ones
.
end
());
new_lens1
.
insert
(
new_lens1
.
begin
(),
ones
.
begin
(),
ones
.
end
());
if
(
not
in0
->
get_shape
().
standard
())
if
(
not
in0
->
get_shape
().
standard
())
...
@@ -77,14 +79,16 @@ void rewrite_gemm::apply(module& m) const
...
@@ -77,14 +79,16 @@ void rewrite_gemm::apply(module& m) const
auto
conv
=
make_op
(
"convolution"
);
auto
conv
=
make_op
(
"convolution"
);
auto
conv_out
=
m
.
replace_instruction
(
ins
,
conv
,
{
in0_transposed
,
in1_transposed
});
auto
conv_out
=
m
.
replace_instruction
(
ins
,
conv
,
{
in0_transposed
,
in1_transposed
});
auto
conv_transpose
=
auto
conv_transpose
=
m
.
insert_instruction
(
m
.
insert_instruction
(
std
::
next
(
conv_out
),
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
2
,
3
,
1
}}}),
conv_out
);
std
::
next
(
conv_out
),
make_op
(
"transpose"
,
{{
"permutation"
,
{
0
,
2
,
3
,
1
}}}),
conv_out
);
auto
out_lens
=
conv_transpose
->
get_shape
().
lens
();
auto
out_lens
=
conv_transpose
->
get_shape
().
lens
();
if
(
out_lens
.
size
()
!=
in_size
)
if
(
out_lens
.
size
()
!=
in_size
)
{
{
out_lens
.
erase
(
out_lens
.
begin
(),
out_lens
.
begin
()
+
(
out_lens
.
size
()
-
in_size
));
out_lens
.
erase
(
out_lens
.
begin
(),
out_lens
.
begin
()
+
(
out_lens
.
size
()
-
in_size
));
m
.
insert_instruction
(
std
::
next
(
conv_transpose
),
make_op
(
"reshape"
,
{{
"dims"
,
out_lens
}}),
conv_transpose
);
m
.
insert_instruction
(
std
::
next
(
conv_transpose
),
make_op
(
"reshape"
,
{{
"dims"
,
out_lens
}}),
conv_transpose
);
}
}
}
}
}
}
...
...
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