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
b3602cf6
Commit
b3602cf6
authored
Jul 12, 2019
by
Rob Earhart
Committed by
Scott Cyphers
Jul 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle negative padding (#3195)
parent
00535470
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
19 deletions
+8
-19
plaidml_ops_general.cpp
src/ngraph/runtime/plaidml/plaidml_ops_general.cpp
+8
-19
No files found.
src/ngraph/runtime/plaidml/plaidml_ops_general.cpp
View file @
b3602cf6
...
...
@@ -212,10 +212,6 @@ void ngraph::runtime::plaidml::ImplPad::Apply()
NGRAPH_DEBUG
<<
"Pad input dims: "
<<
op
().
get_input_shape
(
0
);
NGRAPH_DEBUG
<<
"Pad output dims: "
<<
op
().
get_shape
();
// FIXME: Compatibility hack inserted by amprocte, now that nGraph's Pad op no longer supports
// interior padding.
Shape
padding_interior
(
op
().
get_padding_below
().
size
(),
0
);
auto
dim_limit
=
op
().
get_shape
().
size
();
bool
any_zero_dims
=
false
;
...
...
@@ -230,16 +226,17 @@ void ngraph::runtime::plaidml::ImplPad::Apply()
auto
out_dsize
=
[
&
](
std
::
size_t
idx
)
{
std
::
ostringstream
s
;
std
::
size_t
total_pad
=
op
().
get_padding_below
().
at
(
idx
)
+
op
().
get_padding_above
().
at
(
idx
);
std
::
size_t
in_dsize
=
op
().
get_input_shape
(
0
).
at
(
idx
);
if
(
in_dsize
)
{
total_pad
+=
padding_interior
.
at
(
idx
)
*
(
in_dsize
-
1
);
}
std
::
ptrdiff_t
total_pad
=
op
().
get_padding_below
().
at
(
idx
)
+
op
().
get_padding_above
().
at
(
idx
);
std
::
ptrdiff_t
in_dsize
=
op
().
get_input_shape
(
0
).
at
(
idx
);
if
(
!
any_zero_dims
)
{
s
<<
"DI"
<<
idx
+
1
;
if
(
total_pad
)
if
(
total_pad
<
0
)
{
s
<<
" - "
<<
(
0
-
total_pad
);
}
else
if
(
0
<
total_pad
)
{
s
<<
" + "
<<
total_pad
;
}
...
...
@@ -258,15 +255,7 @@ void ngraph::runtime::plaidml::ImplPad::Apply()
{
s
<<
below
<<
" + "
;
}
auto
interior
=
padding_interior
.
at
(
idx
)
+
1
;
if
(
interior
!=
1
)
{
s
<<
"(d"
<<
idx
+
1
<<
" * "
<<
interior
<<
")"
;
}
else
{
s
<<
"d"
<<
idx
+
1
;
}
return
s
.
str
();
};
...
...
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