@@ -388,7 +388,7 @@ def test_qconv2dbn(randX_100_8_8_1, backend, io_type):
388
388
)
389
389
model .compile ()
390
390
391
- config = hls4ml .utils .config_from_keras_model (model , granularity = 'name' )
391
+ config = hls4ml .utils .config_from_keras_model (model , granularity = 'name' , default_precision = 'fixed<24,8>' )
392
392
output_dir = str (test_root_path / f'hls4mlprj_qkeras_qconv2dbn_{ backend } _{ io_type } ' )
393
393
hls_model = hls4ml .converters .convert_from_keras_model (
394
394
model , hls_config = config , output_dir = output_dir , backend = backend , io_type = io_type
@@ -412,7 +412,7 @@ def randX_10_32_32_3():
412
412
@pytest .mark .parametrize ('io_type' , ['io_stream' ])
413
413
def test_qdepthwiseconv2d (randX_10_32_32_3 , backend , io_type ):
414
414
'''
415
- Test proper handling of QConv2DBatchnorm .
415
+ Test proper handling of QDepthwiseConv2D .
416
416
'''
417
417
X = randX_10_32_32_3
418
418
X = np .round (X * 2 ** 10 ) * 2 ** - 10 # make it an exact ap_fixed<16,6>
@@ -422,15 +422,14 @@ def test_qdepthwiseconv2d(randX_10_32_32_3, backend, io_type):
422
422
kernel_size = (3 , 3 ),
423
423
input_shape = (32 , 32 , 3 ),
424
424
depthwise_quantizer = 'quantized_bits(6, 0, alpha=1)' ,
425
- depthwise_initializer = 'ones' ,
426
425
bias_quantizer = 'quantized_bits(4, 0, alpha=1)' ,
427
- bias_initializer = 'zeros ' ,
426
+ bias_initializer = 'he_normal ' ,
428
427
activation = 'quantized_relu(3, 0)' ,
429
428
)
430
429
)
431
430
model .compile ()
432
431
433
- config = hls4ml .utils .config_from_keras_model (model , granularity = 'name' )
432
+ config = hls4ml .utils .config_from_keras_model (model , granularity = 'name' , default_precision = 'fixed<24,8>' )
434
433
output_dir = str (test_root_path / f'hls4mlprj_qkeras_qdepthwiseconv2d_{ backend } _{ io_type } ' )
435
434
hls_model = hls4ml .converters .convert_from_keras_model (
436
435
model , hls_config = config , output_dir = output_dir , backend = backend , io_type = io_type
0 commit comments