Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
0f2734dc
Commit
0f2734dc
authored
Jan 06, 2020
by
Tomasz Dołbniak
Committed by
Sang Ik Lee
Jan 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use v1::Reshape in ONNX GlobalLpPool (#4090)
Co-authored-by:
Scott Cyphers
<
diyessi@users.noreply.github.com
>
parent
7e319f95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
lp_pool.cpp
src/ngraph/frontend/onnx_import/op/lp_pool.cpp
+10
-11
No files found.
src/ngraph/frontend/onnx_import/op/lp_pool.cpp
View file @
0f2734dc
...
@@ -24,9 +24,6 @@
...
@@ -24,9 +24,6 @@
#include "ngraph/axis_set.hpp"
#include "ngraph/axis_set.hpp"
#include "ngraph/builder/norm.hpp"
#include "ngraph/builder/norm.hpp"
#include "ngraph/builder/split.hpp"
#include "ngraph/builder/split.hpp"
#include "ngraph/op/concat.hpp"
#include "ngraph/op/reshape.hpp"
#include "ngraph/opsets/opset0.hpp"
#include "ngraph/util.hpp"
#include "ngraph/util.hpp"
#include "utils/common.hpp"
#include "utils/common.hpp"
...
@@ -40,10 +37,10 @@ namespace ngraph
...
@@ -40,10 +37,10 @@ namespace ngraph
{
{
NodeVector
global_lp_pool
(
const
Node
&
node
)
NodeVector
global_lp_pool
(
const
Node
&
node
)
{
{
std
::
shared_ptr
<
ngraph
::
Node
>
data
{
node
.
get_ng_inputs
().
at
(
0
)};
const
std
::
shared_ptr
<
ngraph
::
Node
>
data
{
node
.
get_ng_inputs
().
at
(
0
)};
std
::
size_t
channel_axis
{
1
};
const
std
::
size_t
channel_axis
{
1
};
std
::
size_t
channels_count
=
data
->
get_shape
().
at
(
channel_axis
);
const
std
::
size_t
channels_count
=
data
->
get_shape
().
at
(
channel_axis
);
std
::
int64_t
p_norm
{
node
.
get_attribute_value
<
std
::
int64_t
>
(
"p"
,
2
)};
const
std
::
int64_t
p_norm
{
node
.
get_attribute_value
<
std
::
int64_t
>
(
"p"
,
2
)};
ASSERT_VALID_ARGUMENT
(
node
,
p_norm
>=
0
)
ASSERT_VALID_ARGUMENT
(
node
,
p_norm
>=
0
)
<<
"Only positive (including zero) values are supported for 'p' attribute."
;
<<
"Only positive (including zero) values are supported for 'p' attribute."
;
...
@@ -63,10 +60,12 @@ namespace ngraph
...
@@ -63,10 +60,12 @@ namespace ngraph
// output shape is all ones except N channel
// output shape is all ones except N channel
Shape
output_shape
(
orig_shape
.
size
(),
1
);
Shape
output_shape
(
orig_shape
.
size
(),
1
);
output_shape
.
at
(
0
)
=
orig_shape
.
at
(
0
);
output_shape
.
at
(
0
)
=
orig_shape
.
at
(
0
);
slice
=
std
::
make_shared
<
ngraph
::
opset0
::
Reshape
>
(
slice
,
const
auto
reshape_pattern
=
default_opset
::
Constant
::
create
(
ngraph
::
get_default_order
(
slice
->
get_shape
().
size
()),
element
::
i64
,
Shape
{
output_shape
.
size
()},
output_shape
);
output_shape
);
slice
=
std
::
make_shared
<
default_opset
::
Reshape
>
(
slice
,
reshape_pattern
,
false
);
}
}
return
{
std
::
make_shared
<
default_opset
::
Concat
>
(
slices
,
channel_axis
)};
return
{
std
::
make_shared
<
default_opset
::
Concat
>
(
slices
,
channel_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