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
ad30e973
Unverified
Commit
ad30e973
authored
Jan 17, 2019
by
Adam Procter
Committed by
GitHub
Jan 17, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2330 from NervanaSystems/krovatkin/rs_slice_heuristic
A simple heuristic for slice sinker
parents
2f180f90
2dc0c48f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
reshape_sinking.cpp
src/ngraph/pass/reshape_sinking.cpp
+15
-1
No files found.
src/ngraph/pass/reshape_sinking.cpp
View file @
ad30e973
...
...
@@ -473,7 +473,21 @@ bool ngraph::pass::ReshapeSinking::run_on_function(std::shared_ptr<ngraph::Funct
}
else
if
(
auto
slice
=
std
::
dynamic_pointer_cast
<
op
::
Slice
>
(
n
))
{
sink_slice
(
slice
,
reorders
,
reshapes_to_delete
);
// A heuristic. If Reshape has multiple slice users, if sunk
// it will be replicated by the number of its users
// TODO: we should have a pre-pass that looks at this kind of
// scenarios and marks some reshapes as too "toxic" to sink
// For now, this heuristic works really well.
// Note, get_users(*true*) which means we only care about
// live users of Reshape
if
(
slice
->
get_argument
(
0
)
->
get_users
(
true
).
size
()
==
1
)
{
sink_slice
(
slice
,
reorders
,
reshapes_to_delete
);
}
else
{
materialize_shapes
(
n
,
reorders
,
reshapes_to_delete
);
}
}
else
if
(
auto
pad
=
std
::
dynamic_pointer_cast
<
op
::
Pad
>
(
n
))
{
...
...
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