This repository was archived by the owner on Jan 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-20
lines changed
src/ngraph/runtime/plaidml Expand file tree Collapse file tree 1 file changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -212,10 +212,6 @@ void ngraph::runtime::plaidml::ImplPad::Apply()
212
212
NGRAPH_DEBUG << " Pad input dims: " << op ().get_input_shape (0 );
213
213
NGRAPH_DEBUG << " Pad output dims: " << op ().get_shape ();
214
214
215
- // FIXME: Compatibility hack inserted by amprocte, now that nGraph's Pad op no longer supports
216
- // interior padding.
217
- Shape padding_interior (op ().get_padding_below ().size (), 0 );
218
-
219
215
auto dim_limit = op ().get_shape ().size ();
220
216
221
217
bool any_zero_dims = false ;
@@ -230,16 +226,17 @@ void ngraph::runtime::plaidml::ImplPad::Apply()
230
226
231
227
auto out_dsize = [&](std::size_t idx) {
232
228
std::ostringstream s;
233
- std::size_t total_pad = op ().get_padding_below ().at (idx) + op ().get_padding_above ().at (idx);
234
- std::size_t in_dsize = op ().get_input_shape (0 ).at (idx);
235
- if (in_dsize)
236
- {
237
- total_pad += padding_interior.at (idx) * (in_dsize - 1 );
238
- }
229
+ std::ptrdiff_t total_pad =
230
+ op ().get_padding_below ().at (idx) + op ().get_padding_above ().at (idx);
231
+ std::ptrdiff_t in_dsize = op ().get_input_shape (0 ).at (idx);
239
232
if (!any_zero_dims)
240
233
{
241
234
s << " DI" << idx + 1 ;
242
- if (total_pad)
235
+ if (total_pad < 0 )
236
+ {
237
+ s << " - " << (0 - total_pad);
238
+ }
239
+ else if (0 < total_pad)
243
240
{
244
241
s << " + " << total_pad;
245
242
}
@@ -258,15 +255,7 @@ void ngraph::runtime::plaidml::ImplPad::Apply()
258
255
{
259
256
s << below << " + " ;
260
257
}
261
- auto interior = padding_interior.at (idx) + 1 ;
262
- if (interior != 1 )
263
- {
264
- s << " (d" << idx + 1 << " * " << interior << " )" ;
265
- }
266
- else
267
- {
268
- s << " d" << idx + 1 ;
269
- }
258
+ s << " d" << idx + 1 ;
270
259
return s.str ();
271
260
};
272
261
You can’t perform that action at this time.
0 commit comments