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
5f2767aa
Commit
5f2767aa
authored
Oct 15, 2019
by
Paul Fultz II
Committed by
mvermeulen
Oct 15, 2019
Browse files
Add more shape operators that can be nops (#390)
* Add more shape operators that can be nops * Dont remove pooling
parent
193a3b7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
src/simplify_reshapes.cpp
src/simplify_reshapes.cpp
+7
-1
No files found.
src/simplify_reshapes.cpp
View file @
5f2767aa
...
@@ -17,6 +17,7 @@ const auto& reshaper_names()
...
@@ -17,6 +17,7 @@ const auto& reshaper_names()
{
{
// clang-format off
// clang-format off
static
const
std
::
unordered_set
<
std
::
string
>
names
=
{
static
const
std
::
unordered_set
<
std
::
string
>
names
=
{
"flatten"
,
"reshape"
,
"reshape"
,
"contiguous"
,
"contiguous"
,
"squeeze"
,
"squeeze"
,
...
@@ -98,8 +99,13 @@ struct find_nop_reshapes
...
@@ -98,8 +99,13 @@ struct find_nop_reshapes
auto
matcher
()
const
auto
matcher
()
const
{
{
auto
reshapes
=
reshaper_names
();
auto
reshapes
=
reshaper_names
();
reshapes
.
insert
(
"transpose"
);
reshapes
.
insert
(
"as_shape"
);
reshapes
.
insert
(
"broadcast"
);
reshapes
.
insert
(
"concat"
);
reshapes
.
insert
(
"multibroadcast"
);
reshapes
.
insert
(
"pad"
);
reshapes
.
insert
(
"slice"
);
reshapes
.
insert
(
"slice"
);
reshapes
.
insert
(
"transpose"
);
return
match
::
name
(
reshapes
)(
match
::
same_shape
(
match
::
arg
(
0
)));
return
match
::
name
(
reshapes
)(
match
::
same_shape
(
match
::
arg
(
0
)));
}
}
...
...
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