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
5e0fdc60
Commit
5e0fdc60
authored
6 years ago
by
amy.zhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addressed PR feedback.
parent
4fb88c5b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
15 deletions
+4
-15
cpu_memory_optimization.cpp
src/ngraph/runtime/cpu/pass/cpu_memory_optimization.cpp
+4
-15
No files found.
src/ngraph/runtime/cpu/pass/cpu_memory_optimization.cpp
View file @
5e0fdc60
...
...
@@ -46,8 +46,6 @@
///
/// After optimization: the result of add1 is stored to the memory buffer assigned to concat, same for add2 and add3.
#include <cassert>
#include "ngraph/runtime/cpu/pass/cpu_memory_optimization.hpp"
#include "ngraph/descriptor/output.hpp"
...
...
@@ -80,16 +78,13 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
}
bool
in_place_concat
=
true
;
AxisVector
axis_list
;
for
(
auto
i
=
0
;
i
<
shape
.
size
();
i
++
)
{
axis_list
.
push_back
(
i
);
}
AxisVector
axis_list
=
ngraph
::
get_default_order
(
shape
);
auto
index
=
0
;
for
(
descriptor
::
Input
&
input
:
concat
->
get_inputs
())
{
// no tensors with zero-sized dimensions after zero_dim_tensor_elimination
assert
(
shape_size
(
input
.
get_shape
())
!=
0
);
NGRAPH_ASSERT
(
shape_size
(
input
.
get_shape
())
!=
0
);
// check if input layout is padded
auto
input_md
=
mkldnn_utils
::
get_input_mkldnn_md
(
n
.
get
(),
index
);
...
...
@@ -113,13 +108,7 @@ bool runtime::cpu::pass::CPUMemoryOptimization::run_on_function(std::shared_ptr<
break
;
}
if
(
arg
->
get_output_size
()
!=
1
)
{
NGRAPH_DEBUG
<<
"cpu_memory_optimization: "
<<
arg
->
get_name
()
<<
": multiple outputs, no in place concat"
;
in_place_concat
=
false
;
break
;
}
NGRAPH_ASSERT
(
arg
->
get_output_size
()
==
1
);
if
(
!
std
::
dynamic_pointer_cast
<
op
::
Concat
>
(
arg
))
{
...
...
This diff is collapsed.
Click to expand it.
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