@@ -388,7 +388,7 @@ def test_qconv2dbn(randX_100_8_8_1, backend, io_type):
388388 )
389389 model .compile ()
390390
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>' )
392392 output_dir = str (test_root_path / f'hls4mlprj_qkeras_qconv2dbn_{ backend } _{ io_type } ' )
393393 hls_model = hls4ml .converters .convert_from_keras_model (
394394 model , hls_config = config , output_dir = output_dir , backend = backend , io_type = io_type
@@ -412,7 +412,7 @@ def randX_10_32_32_3():
412412@pytest .mark .parametrize ('io_type' , ['io_stream' ])
413413def test_qdepthwiseconv2d (randX_10_32_32_3 , backend , io_type ):
414414 '''
415- Test proper handling of QConv2DBatchnorm .
415+ Test proper handling of QDepthwiseConv2D .
416416 '''
417417 X = randX_10_32_32_3
418418 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):
422422 kernel_size = (3 , 3 ),
423423 input_shape = (32 , 32 , 3 ),
424424 depthwise_quantizer = 'quantized_bits(6, 0, alpha=1)' ,
425- depthwise_initializer = 'ones' ,
426425 bias_quantizer = 'quantized_bits(4, 0, alpha=1)' ,
427- bias_initializer = 'zeros ' ,
426+ bias_initializer = 'he_normal ' ,
428427 activation = 'quantized_relu(3, 0)' ,
429428 )
430429 )
431430 model .compile ()
432431
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>' )
434433 output_dir = str (test_root_path / f'hls4mlprj_qkeras_qdepthwiseconv2d_{ backend } _{ io_type } ' )
435434 hls_model = hls4ml .converters .convert_from_keras_model (
436435 model , hls_config = config , output_dir = output_dir , backend = backend , io_type = io_type
0 commit comments