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
d1e0225d
Commit
d1e0225d
authored
Aug 12, 2019
by
Paul
Browse files
Formatting
parent
379ef733
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
src/include/migraphx/rewrite_pooling.hpp
src/include/migraphx/rewrite_pooling.hpp
+0
-1
src/rewrite_pooling.cpp
src/rewrite_pooling.cpp
+8
-8
No files found.
src/include/migraphx/rewrite_pooling.hpp
View file @
d1e0225d
...
@@ -16,7 +16,6 @@ struct rewrite_pooling
...
@@ -16,7 +16,6 @@ struct rewrite_pooling
{
{
std
::
string
name
()
const
{
return
"rewrite_pooling"
;
}
std
::
string
name
()
const
{
return
"rewrite_pooling"
;
}
void
apply
(
program
&
prog
)
const
;
void
apply
(
program
&
prog
)
const
;
};
};
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace MIGRAPHX_INLINE_NS
...
...
src/rewrite_pooling.cpp
View file @
d1e0225d
...
@@ -12,21 +12,21 @@ void rewrite_pooling::apply(program& prog) const
...
@@ -12,21 +12,21 @@ void rewrite_pooling::apply(program& prog) const
{
{
for
(
auto
ins
:
iterator_for
(
prog
))
for
(
auto
ins
:
iterator_for
(
prog
))
{
{
if
(
ins
->
name
()
!=
"pooling"
)
if
(
ins
->
name
()
!=
"pooling"
)
continue
;
continue
;
if
(
ins
->
get_shape
().
lens
().
size
()
!=
4
)
if
(
ins
->
get_shape
().
lens
().
size
()
!=
4
)
continue
;
continue
;
if
(
ins
->
inputs
().
empty
())
if
(
ins
->
inputs
().
empty
())
continue
;
continue
;
auto
&&
s
=
ins
->
inputs
().
front
()
->
get_shape
();
auto
&&
s
=
ins
->
inputs
().
front
()
->
get_shape
();
auto
&&
op
=
any_cast
<
op
::
pooling
>
(
ins
->
get_operator
());
auto
&&
op
=
any_cast
<
op
::
pooling
>
(
ins
->
get_operator
());
if
(
op
.
mode
!=
"average"
)
if
(
op
.
mode
!=
"average"
)
continue
;
continue
;
if
(
op
.
padding
[
0
]
!=
0
and
op
.
padding
[
1
]
!=
0
)
if
(
op
.
padding
[
0
]
!=
0
and
op
.
padding
[
1
]
!=
0
)
continue
;
continue
;
if
(
op
.
stride
[
0
]
!=
1
and
op
.
stride
[
1
]
!=
1
)
if
(
op
.
stride
[
0
]
!=
1
and
op
.
stride
[
1
]
!=
1
)
continue
;
continue
;
if
(
s
.
lens
()[
2
]
!=
op
.
lengths
[
0
]
and
s
.
lens
()[
3
]
!=
op
.
lengths
[
1
])
if
(
s
.
lens
()[
2
]
!=
op
.
lengths
[
0
]
and
s
.
lens
()[
3
]
!=
op
.
lengths
[
1
])
continue
;
continue
;
prog
.
replace_instruction
(
ins
,
op
::
reduce_mean
{{
2
,
3
}},
ins
->
inputs
().
front
());
prog
.
replace_instruction
(
ins
,
op
::
reduce_mean
{{
2
,
3
}},
ins
->
inputs
().
front
());
}
}
...
...
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