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
708c0401
Commit
708c0401
authored
Jul 19, 2019
by
Khalique
Browse files
formatting
parent
0420b20d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
src/tf/tf.cpp
src/tf/tf.cpp
+5
-6
No files found.
src/tf/tf.cpp
View file @
708c0401
...
@@ -577,8 +577,8 @@ struct tf_parser
...
@@ -577,8 +577,8 @@ struct tf_parser
bool
keep_dims
=
attributes
.
at
(
"keep_dims"
).
b
();
bool
keep_dims
=
attributes
.
at
(
"keep_dims"
).
b
();
// std::vector<int32_t> hw_axes{2, 3};
// std::vector<int32_t> hw_axes{2, 3};
// check if conditions for GlobalAvgPool are met
// check if conditions for GlobalAvgPool are met
auto
lens
=
args
[
0
]
->
get_shape
().
lens
();
auto
lens
=
args
[
0
]
->
get_shape
().
lens
();
auto
axes
=
args
[
1
]
->
eval
().
get
<
int32_t
>
().
to_vector
();
auto
axes
=
args
[
1
]
->
eval
().
get
<
int32_t
>
().
to_vector
();
std
::
vector
<
int64_t
>
axes_int64
=
std
::
vector
<
int64_t
>
(
axes
.
begin
(),
axes
.
end
());
std
::
vector
<
int64_t
>
axes_int64
=
std
::
vector
<
int64_t
>
(
axes
.
begin
(),
axes
.
end
());
// if(axes == hw_axes and lens.size() == 4)
// if(axes == hw_axes and lens.size() == 4)
...
@@ -586,11 +586,10 @@ struct tf_parser
...
@@ -586,11 +586,10 @@ struct tf_parser
// op::pooling op{"average"};
// op::pooling op{"average"};
// op.lengths[0] = lens[2];
// op.lengths[0] = lens[2];
// op.lengths[1] = lens[3];
// op.lengths[1] = lens[3];
auto
l0
=
prog
.
add_instruction
(
op
::
reduce_mean
{
axes_int64
},
args
.
front
());
auto
l0
=
prog
.
add_instruction
(
op
::
reduce_mean
{
axes_int64
},
args
.
front
());
if
(
keep_dims
)
if
(
keep_dims
)
return
l0
;
return
l0
;
return
prog
.
add_instruction
(
return
prog
.
add_instruction
(
op
::
squeeze
{
axes_int64
},
l0
);
op
::
squeeze
{
axes_int64
},
l0
);
// }
// }
// MIGRAPHX_THROW("MIGraphX does not support mean outside of GlobalAvgPool transformation");
// MIGRAPHX_THROW("MIGraphX does not support mean outside of GlobalAvgPool transformation");
}
}
...
@@ -770,7 +769,7 @@ struct tf_parser
...
@@ -770,7 +769,7 @@ struct tf_parser
const
attribute_map
&
attributes
,
const
attribute_map
&
attributes
,
std
::
vector
<
instruction_ref
>
args
)
std
::
vector
<
instruction_ref
>
args
)
{
{
int
axis
=
-
1
;
int
axis
=
-
1
;
auto
num_dims
=
args
[
0
]
->
get_shape
().
lens
().
size
();
auto
num_dims
=
args
[
0
]
->
get_shape
().
lens
().
size
();
if
(
contains
(
attributes
,
"axis"
))
if
(
contains
(
attributes
,
"axis"
))
{
{
...
...
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