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
7ad4d5c1
Commit
7ad4d5c1
authored
Jul 16, 2019
by
Adam Rogowiec
Committed by
Scott Cyphers
Jul 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle slice start past the end case. (#3157)
parent
358efff9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
slice.cpp
src/ngraph/frontend/onnx_import/op/slice.cpp
+10
-0
No files found.
src/ngraph/frontend/onnx_import/op/slice.cpp
View file @
7ad4d5c1
...
...
@@ -18,6 +18,7 @@
#include <memory>
#include <vector>
#include "ngraph/log.hpp"
#include "ngraph/node.hpp"
#include "ngraph/op/slice.hpp"
#include "slice.hpp"
...
...
@@ -59,6 +60,15 @@ namespace ngraph
get_valid_array_idx
(
ends
.
at
(
idx
),
data_shape
.
at
(
axis
));
}
// Check for cases when start is greater than end and change them to "empty" slice.
for
(
auto
idx
=
0
;
idx
<
lower_bounds
.
size
();
++
idx
)
{
if
(
lower_bounds
.
at
(
idx
)
>
upper_bounds
.
at
(
idx
))
{
upper_bounds
.
at
(
idx
)
=
lower_bounds
.
at
(
idx
);
}
}
return
{
std
::
make_shared
<
ngraph
::
op
::
Slice
>
(
data
,
lower_bounds
,
upper_bounds
)};
}
...
...
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