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
01cf38ee
Commit
01cf38ee
authored
Jun 07, 2019
by
Adam Procter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comment edits
parent
19e6dfcf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
dyn_elimination.cpp
src/ngraph/pass/dyn_elimination.cpp
+7
-9
No files found.
src/ngraph/pass/dyn_elimination.cpp
View file @
01cf38ee
...
...
@@ -87,7 +87,7 @@ void pass::DynElimination::construct_transpose()
// v
// Reshape (non-transposing, to handle shrinks)
// |
// v
const
// v
// Reverse (to emulate backwards stride)
//
// (The Reshape, Reverse, or both may be omitted if they would just be identities.)
...
...
@@ -172,7 +172,7 @@ static SlicePlan make_plan(const Shape& input_shape,
p
.
reshape_out_shape
=
Shape
(
num_new_axes
+
num_real_axes
+
ellipsis_size
-
num_shrink_axes
);
p
.
reverse_axes
=
AxisSet
{};
// Begin a maddeningly delicate loop to desugar the original slice
specs
.
// Begin a maddeningly delicate loop to desugar the original slice.
//
// * i_in is iterating over the axes of the input shape, which are also the axes of
// p.reshape_in_shape.
...
...
@@ -199,16 +199,15 @@ static SlicePlan make_plan(const Shape& input_shape,
for
(
size_t
i
=
0
;
i
<
num_slice_indices
;
i
++
)
{
// If this is a "newaxis", we throw a 1 into the final shape, but it
// will not be present in the intermediate shape and does not
// correspond to anything in the original shape.
// If this is a "newaxis", then reshape_out_shape will have a 1 here,
// but reshape_in_shape will not.
if
(
new_axis_mask
.
count
(
i
))
{
p
.
reshape_out_shape
[
i_out
]
=
1
;
i_out
++
;
}
// If this is a "shrunken" axis, the
intermediate shape will have a
//
"1" here, but nothing will be there in the final shape
.
// If this is a "shrunken" axis, the
n reshape_in_shape will have a 1
//
here, but reshape_out_shape will not
.
else
if
(
shrink_axis_mask
.
count
(
i
))
{
int64_t
begin
=
begins
[
i
];
...
...
@@ -228,8 +227,7 @@ static SlicePlan make_plan(const Shape& input_shape,
p
.
reshape_in_shape
[
i_in
]
=
1
;
i_in
++
;
}
// If this is the ellipsis, expand it (see expand_ellipsis above for
// details).
// If this is the ellipsis, expand it.
else
if
(
ellipsis_mask
.
count
(
i
))
{
expand_ellipsis
();
...
...
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