Skip to content

Commit c5841a2

Browse files
committed
seperate out parse_qonnx flow
1 parent 2a78f93 commit c5841a2

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

hls4ml/model/optimizer/__init__.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
del optimizers
3232

3333
register_flow(
34-
'convert',
34+
'parse_qonnx',
3535
[
3636
'reshape_constant',
3737
'quant_constant_parameters',
@@ -51,9 +51,16 @@
5151
'merge_to_apply_alpha_div',
5252
'matmul_const_to_dense',
5353
'conv_to_conv_x_d',
54-
'fuse_consecutive_batch_normalization', # needs to be before infer_precision_types
55-
'merge_linear_activation', # needs to be before infer_precision_types
56-
'fuse_batch_normalization', # needs to be before infer_precision_types
54+
],
55+
)
56+
57+
register_flow(
58+
'convert',
59+
[
60+
'fuse_consecutive_batch_normalization',
61+
'merge_linear_activation',
62+
'fuse_batch_normalization',
63+
# The ones above here need to be before infer_precision_types
5764
'infer_precision_types',
5865
'channels_last_converter',
5966
'remove_transpose_before_flatten',
@@ -65,6 +72,7 @@
6572
'qkeras_factorize_alpha',
6673
'extract_ternary_threshold',
6774
],
75+
requires=['parse_qonnx'],
6876
) # TODO Maybe not all QKeras optmizers belong here?
6977

7078
register_flow(

0 commit comments

Comments
 (0)