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
711aff2b
Commit
711aff2b
authored
Nov 02, 2018
by
Khalique
Browse files
revert to array
parent
051338be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
src/include/migraph/operators.hpp
src/include/migraph/operators.hpp
+1
-1
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+5
-8
No files found.
src/include/migraph/operators.hpp
View file @
711aff2b
...
...
@@ -182,7 +182,7 @@ struct pooling
std
::
string
mode
=
"average"
;
std
::
array
<
std
::
size_t
,
2
>
padding
=
{{
0
,
0
}};
std
::
array
<
std
::
size_t
,
2
>
stride
=
{{
1
,
1
}};
std
::
vector
<
std
::
size_t
>
lengths
=
{{
1
,
1
}};
std
::
array
<
std
::
size_t
,
2
>
lengths
=
{{
1
,
1
}};
template
<
class
Self
,
class
F
>
static
auto
reflect
(
Self
&
self
,
F
f
)
...
...
src/onnx/onnx.cpp
View file @
711aff2b
...
...
@@ -150,14 +150,11 @@ struct onnx_parser
attribute_map
attributes
,
std
::
vector
<
instruction_ref
>
args
)
{
op
::
pooling
op
{
name
==
"MaxPool"
or
name
==
"GlobalMaxPool"
?
"max"
:
"average"
};
if
(
name
==
"GlobalMaxPool"
or
name
==
"GlobalAveragePool"
)
{
auto
lens
=
args
.
front
()
->
get_shape
().
lens
();
auto
num_lengths
=
lens
.
size
()
-
2
;
// ignore N and C values in lens
assert
(
num_lengths
>
0
);
op
.
lengths
=
std
::
vector
<
std
::
size_t
>
(
num_lengths
);
std
::
copy_n
(
lens
.
begin
()
+
2
,
num_lengths
,
op
.
lengths
.
begin
());
op
::
pooling
op
{
ends_with
(
name
,
"MaxPool"
)
?
"max"
:
"average"
};
if
(
starts_with
(
name
,
"Global"
))
{
auto
lens
=
args
.
front
()
->
get_shape
().
lens
();
op
.
lengths
=
{
lens
[
2
],
lens
[
3
]};
}
if
(
contains
(
attributes
,
"pads"
))
{
...
...
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