Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
a5bebb21
Commit
a5bebb21
authored
May 20, 2019
by
Khalique
Browse files
add lens variable to simplify code
parent
31436830
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
src/tf/tf.cpp
src/tf/tf.cpp
+4
-4
No files found.
src/tf/tf.cpp
View file @
a5bebb21
...
...
@@ -431,12 +431,12 @@ struct tf_parser
bool
keep_dims
=
attributes
.
at
(
"keep_dims"
).
b
();
std
::
vector
<
int32_t
>
hw_axes
{
2
,
3
};
// check if conditions for GlobalAvgPool are met
if
(
axes
==
hw_axes
and
args
[
0
]
->
get_shape
().
lens
().
size
()
==
4
)
auto
lens
=
args
[
0
]
->
get_shape
().
lens
();
if
(
axes
==
hw_axes
and
lens
.
size
()
==
4
)
{
op
::
pooling
op
{
"average"
};
std
::
vector
<
size_t
>
input_dims
{
args
[
0
]
->
get_shape
().
lens
()};
op
.
lengths
[
0
]
=
input_dims
[
2
];
op
.
lengths
[
1
]
=
input_dims
[
3
];
op
.
lengths
[
0
]
=
lens
[
2
];
op
.
lengths
[
1
]
=
lens
[
3
];
auto
l0
=
prog
.
add_instruction
(
op
,
args
.
front
());
if
(
keep_dims
)
return
l0
;
...
...
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