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
630bd1ab
Commit
630bd1ab
authored
Jun 07, 2019
by
Adam Procter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a couple more bugs, add a bunch of unit tests
parent
1af4d95a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
dyn_elimination.cpp
src/ngraph/pass/dyn_elimination.cpp
+9
-1
dyn_slice_test.in.cpp
test/dyn_slice_test.in.cpp
+0
-0
generate_dyn_slice_ref.py
test/ref_generators/generate_dyn_slice_ref.py
+0
-0
No files found.
src/ngraph/pass/dyn_elimination.cpp
View file @
630bd1ab
...
...
@@ -265,7 +265,8 @@ static SlicePlan make_plan(const Shape& input_shape,
int64_t
min_real_end
=
(
is_reverse
?
-
1
:
0
);
real_end
=
std
::
max
(
min_real_end
,
std
::
min
(
int64_t
(
input_shape
[
i_in
]),
real_end
));
// Adjust the stride for backwards slicing.
// Ensure stride is not zero, and adjust it for backwards slicing.
NGRAPH_CHECK
(
strides
[
i
]
!=
0
);
int64_t
real_stride
=
std
::
abs
(
strides
[
i
]);
// Adjust for reversal if needed. This isn't quite as simple as swapping begin and
...
...
@@ -281,6 +282,13 @@ static SlicePlan make_plan(const Shape& input_shape,
p
.
reverse_axes
.
insert
(
i_out
);
}
// nGraph's slice op does not like it when end < begin, so we truncate for that case
// here.
if
(
real_end
<
real_begin
)
{
real_end
=
real_begin
;
}
// Compute output dimension.
size_t
dim
=
(
real_end
<=
real_begin
?
0
...
...
test/dyn_slice_test.in.cpp
View file @
630bd1ab
This source diff could not be displayed because it is too large. You can
view the blob
instead.
test/ref_generators/generate_dyn_slice_ref.py
View file @
630bd1ab
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