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
eec19220
Commit
eec19220
authored
7 years ago
by
Jaikrishnan Menon
Committed by
Scott Cyphers
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CPU: Eliminate slices (#849)
parent
6e1b6058
master
v0.29.0-rc.0
v0.28.0-rc.1
v0.28.0-rc.0
v0.27.1-rc.3
v0.27.1-rc.2
v0.27.1-rc.1
v0.27.1-rc.0
v0.27.0-rc.1
v0.27.0-rc.0
v0.26.1-rc.0
v0.26.0
v0.26.0-rc.8
v0.26.0-rc.7
v0.26.0-rc.6
v0.26.0-rc.5
v0.26.0-rc.4
v0.26.0-rc.3
v0.26.0-rc.2
v0.26.0-rc.0
v0.25.1-rc.11
v0.25.1-rc.10
v0.25.1-rc.9
v0.25.1-rc.8
v0.25.1-rc.7
v0.25.1-rc.6
v0.25.1-rc.5
v0.25.1-rc.4
v0.25.1-rc.3
v0.25.1-rc.2
v0.25.1-rc.1
v0.25.1-rc.0
v0.25.0
v0.25.0-rc.3
v0.25.0-rc.2
v0.25.0-rc.1
v0.25.0-rc.0
v0.25.0-dev.0
v0.24.0
v0.24.0-rc.3
v0.24.0-rc.2
v0.24.0-rc.1
v0.24.0-rc.0
v0.23.0-rc.7
v0.23.0-rc.6
v0.23.0-rc.5
v0.23.0-rc.4
v0.23.0-rc.3
v0.23.0-rc.2
v0.23.0-rc.1
v0.23.0-rc.0
v0.22.2-rc.0
v0.22.1
v0.22.1-rc.0
v0.22.0
v0.22.0-rc.2
v0.22.0-rc.0
v0.21.0
v0.21.0-rc.1
v0.21.0-rc.0
v0.20.1-rc.4
v0.20.1-rc.3
v0.20.1-rc.2
v0.20.1-rc.1
v0.20.1-rc.0
v0.20.0-rc.2
v0.20.0-rc.1
v0.20.0-rc.0
v0.20.0-dev.0
v0.19.1
v0.19.1-rc.0
v0.19.0
v0.19.0-rc.5
v0.19.0-rc.4
v0.19.0-rc.3
v0.19.0-rc.2
v0.19.0-rc.1
v0.19.0-rc.0
v0.18.1
v0.18.1-rc.1
v0.18.1-rc.0
v0.18.0
v0.18.0-rc.2
v0.18.0-rc.1
v0.18.0-rc.0
v0.17.0-rc.1
v0.17.0-rc.0
v0.16.0-rc.3
v0.16.0-rc.2
v0.16.0-rc.1
v0.16.0-rc.0
v0.15.1-rc.2
v0.15.1-rc.1
v0.15.0
v0.15.0-rc.2
v0.15.0-rc.1
v0.15.0-rc.0
v0.14.0
v0.14.0-rc.1
v0.14.0-rc.0
v0.13.0
v0.12.0
v0.12.0-rc.2
v0.12.0-rc.1
v0.12.0-rc.0
v0.11.1
v0.11.0
v0.11.0-rc.1
v0.11.0-rc.0
v0.10.1
v0.10.0
v0.10.0-rc.6
v0.10.0-rc.5
v0.10.0-rc.4
v0.10.0-rc.3
v0.10.0-rc.2
v0.10.0-rc.1
v0.10.0-rc.0
v0.9.1
v0.9.1-rc.0
v0.9.0
v0.9.0-rc.5
v0.9.0-rc.4
v0.9.0-rc.3
v0.9.0-rc.2
v0.9.0-rc.1
v0.9.0-rc.0
v0.8.2-rc.0
v0.8.1
v0.8.1-rc.0
v0.8.0
v0.8.0-rc.2
v0.8.0-rc.1
v0.8.0-rc.0
v0.7.0
v0.6.0
v0.6.0rc0
v0.6.0-rc.0
v0.6.0-rc0
v0.5.0
v0.4.0
v0.3.0
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
cpu_nop_elimination.cpp
src/ngraph/runtime/cpu/pass/cpu_nop_elimination.cpp
+14
-1
No files found.
src/ngraph/runtime/cpu/pass/cpu_nop_elimination.cpp
View file @
eec19220
...
...
@@ -23,6 +23,7 @@
#include "cpu_nop_elimination.hpp"
#include "ngraph/op/convert.hpp"
#include "ngraph/op/pad.hpp"
#include "ngraph/op/slice.hpp"
#include "ngraph/op/sum.hpp"
#define TI(x) std::type_index(typeid(x))
...
...
@@ -64,12 +65,24 @@ HANDLER_DECL(eliminate_convert)
return
false
;
}
HANDLER_DECL
(
eliminate_slice
)
{
auto
slice
=
std
::
dynamic_pointer_cast
<
ngraph
::
op
::
Slice
>
(
node
);
if
(
slice
->
get_input_shape
(
0
)
==
slice
->
get_output_shape
(
0
))
{
function
->
replace_node
(
node
,
node
->
get_input_op
(
0
));
return
true
;
}
return
false
;
}
static
const
std
::
unordered_map
<
std
::
type_index
,
std
::
function
<
bool
(
const
std
::
shared_ptr
<
ngraph
::
Function
>&
,
const
std
::
shared_ptr
<
ngraph
::
Node
>&
)
>>
dispatcher
{{
TI
(
ngraph
::
op
::
Pad
),
&
eliminate_pad
},
{
TI
(
ngraph
::
op
::
Sum
),
&
eliminate_sum
},
{
TI
(
ngraph
::
op
::
Convert
),
&
eliminate_convert
}};
{
TI
(
ngraph
::
op
::
Convert
),
&
eliminate_convert
},
{
TI
(
ngraph
::
op
::
Slice
),
&
eliminate_slice
}};
bool
ngraph
::
runtime
::
cpu
::
pass
::
CPUNopElimination
::
run_on_function
(
std
::
shared_ptr
<
ngraph
::
Function
>
function
)
...
...
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