@@ -30,20 +30,19 @@ def keras_model_ave():
30
30
return model
31
31
32
32
33
- @pytest .mark .parametrize ("configuration" , [("ave" , 'io_parallel' ),
34
- ("ave" , 'io_stream' ),
35
- ("max" , 'io_parallel' ),
36
- ("max" , 'io_stream' )])
37
- def test_global_pool1d (keras_model_max , keras_model_ave , data , configuration ):
33
+ @pytest .mark .parametrize ('io_type' , ['io_parallel' , 'io_stream' ])
34
+ @pytest .mark .parametrize ('model_type' , ['max' , 'ave' ])
35
+ def test_global_pool1d (keras_model_max , keras_model_ave , data , model_type , io_type ):
38
36
model_type , io_type = configuration
39
- if model_type == " ave" :
37
+ if model_type == ' ave' :
40
38
model = keras_model_ave
41
39
else :
42
40
model = keras_model_max
43
- config = hls4ml .utils .config_from_keras_model (model , default_precision = 'ap_fixed<32,1>' ,
41
+ config = hls4ml .utils .config_from_keras_model (model ,
42
+ default_precision = 'ap_fixed<32,1>' ,
44
43
granularity = 'name' )
45
- if model_type == " ave" :
46
- config ['LayerName' ]['global_average_pooling1d' ]['Precision' ] = 'ap_fixed<32,6>'
44
+ if model_type == ' ave' :
45
+ config ['LayerName' ]['global_average_pooling1d' ]['accum_t' ] = 'ap_fixed<32,6>'
47
46
48
47
hls_model = hls4ml .converters .convert_from_keras_model (model ,
49
48
hls_config = config ,
0 commit comments