@@ -165,7 +165,6 @@ def test_conv1d(padds, backend, io_type):
165
165
assert list (hls_model .get_layers ())[1 ].attributes ['n_chan' ] == model .layers [0 ].input_shape [2 ]
166
166
assert list (hls_model .get_layers ())[1 ].attributes ['n_filt' ] == model .layers [0 ].filters
167
167
assert list (hls_model .get_layers ())[1 ].attributes ['stride_width' ] == model .layers [0 ].strides [0 ]
168
- assert list (hls_model .get_layers ())[1 ].attributes ['padding' ] == model .layers [0 ].padding
169
168
assert list (hls_model .get_layers ())[1 ].attributes ['data_format' ] == model .layers [0 ].data_format
170
169
assert list (hls_model .get_layers ())[1 ].attributes ["out_width" ] == list (model .layers [0 ].output_shape )[1 ]
171
170
@@ -235,7 +234,6 @@ def test_conv2d(chans, padds, backend, io_type):
235
234
assert list (hls_model .get_layers ())[1 ].attributes ['n_filt' ] == model .layers [0 ].filters
236
235
assert list (hls_model .get_layers ())[1 ].attributes ['stride_width' ] == model .layers [0 ].strides [1 ]
237
236
assert list (hls_model .get_layers ())[1 ].attributes ['stride_height' ] == model .layers [0 ].strides [0 ]
238
- assert list (hls_model .get_layers ())[1 ].attributes ['padding' ] == model .layers [0 ].padding
239
237
assert list (hls_model .get_layers ())[1 ].attributes ['data_format' ] == model .layers [0 ].data_format
240
238
241
239
if model .layers [0 ].data_format == 'channels_first' :
@@ -392,7 +390,6 @@ def test_pooling(pooling, padds, chans, backend):
392
390
assert hls_pool .attributes ['stride_width' ] == ker_pool .strides [1 ]
393
391
assert hls_pool .attributes ['pool_height' ] == ker_pool .pool_size [1 ]
394
392
assert hls_pool .attributes ['pool_width' ] == ker_pool .pool_size [0 ]
395
- assert hls_pool .attributes ['padding' ] == ker_pool .padding
396
393
397
394
if hls_pool .attributes ['data_format' ] == 'channels_last' :
398
395
assert hls_pool .attributes ['in_height' ] == ker_pool .input_shape [1 ]
@@ -403,7 +400,7 @@ def test_pooling(pooling, padds, chans, backend):
403
400
assert hls_pool .attributes ['in_width' ] == ker_pool .input_shape [3 ]
404
401
assert hls_pool .attributes ['n_filt' ] == ker_pool .input_shape [1 ]
405
402
406
- if hls_pool . attributes [ ' padding' ] == 'same' :
403
+ if ker_pool . padding == 'same' :
407
404
# Height
408
405
in_height = ker_pool .input_shape [1 ]
409
406
if ker_pool .data_format == 'channels_first' :
@@ -434,7 +431,7 @@ def test_pooling(pooling, padds, chans, backend):
434
431
assert pad_left == hls_pool .attributes ['pad_left' ]
435
432
assert pad_right == hls_pool .attributes ['pad_right' ]
436
433
437
- elif hls_pool . attributes [ ' padding' ] == 'valid' :
434
+ elif ker_pool . padding == 'valid' :
438
435
if hls_pool .attributes ['data_format' ] == 'channels_first' :
439
436
in_height = ker_pool .input_shape [2 ]
440
437
in_width = ker_pool .input_shape [3 ]
@@ -459,12 +456,11 @@ def test_pooling(pooling, padds, chans, backend):
459
456
assert hls_pool .attributes ['n_filt' ] == ker_pool .input_shape [2 ]
460
457
assert hls_pool .attributes ['pool_width' ] == ker_pool .pool_size [0 ]
461
458
assert hls_pool .attributes ['stride_width' ] == ker_pool .strides [0 ]
462
- assert hls_pool .attributes ['padding' ] == ker_pool .padding
463
459
464
460
out_same = math .ceil (float (ker_pool .input_shape [1 ]) / float (ker_pool .strides [0 ]))
465
461
out_valid = math .ceil (float (ker_pool .input_shape [1 ] - ker_pool .pool_size [0 ] + 1 ) / ker_pool .strides [0 ])
466
462
467
- if hls_pool . attributes [ ' padding' ] == 'same' :
463
+ if ker_pool . padding == 'same' :
468
464
assert hls_pool .attributes ['n_out' ] == out_same
469
465
if ker_pool .input_shape [1 ] % ker_pool .strides [0 ] == 0 :
470
466
pad_along_width = max (ker_pool .pool_size [0 ] - ker_pool .strides [0 ], 0 )
@@ -473,7 +469,7 @@ def test_pooling(pooling, padds, chans, backend):
473
469
assert hls_pool .attributes ['pad_left' ] == pad_along_width // 2
474
470
assert hls_pool .attributes ['pad_right' ] == pad_along_width - pad_along_width // 2
475
471
476
- elif hls_pool . attributes [ ' padding' ] == 'valid' :
472
+ elif ker_pool . padding == 'valid' :
477
473
assert hls_pool .attributes ['n_out' ] == out_valid
478
474
assert hls_pool .attributes ['pad_left' ] == 0
479
475
assert hls_pool .attributes ['pad_right' ] == 0
0 commit comments