diff options
author | Louis Verhaard <louis.verhaard@arm.com> | 2020-09-01 10:39:04 +0200 |
---|---|---|
committer | Louis Verhaard <louis.verhaard@arm.com> | 2020-09-08 09:02:49 +0200 |
commit | 98a3499ec73b26880c633caf9a43bfe80f9ec1ed (patch) | |
tree | 2a098625e57dcd75e7aafd1ee340f971c62ffed7 /ethosu/vela/weight_compressor.py | |
parent | 515c956c9cc6d45493e45d57b822e30a7317d1ed (diff) | |
download | ethos-u-vela-98a3499ec73b26880c633caf9a43bfe80f9ec1ed.tar.gz |
MLBEDSW-2935: LUT fusing with preceding operator
Allows fusing of LUT with a preceding operator regardless of
input/output scale.
Change-Id: Ia378adbb3fe61d71299feb085f7313377e0efa39
Signed-off-by: Louis Verhaard <louis.verhaard@arm.com>
Diffstat (limited to 'ethosu/vela/weight_compressor.py')
-rw-r--r-- | ethosu/vela/weight_compressor.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ethosu/vela/weight_compressor.py b/ethosu/vela/weight_compressor.py index 175646b8..2374cd42 100644 --- a/ethosu/vela/weight_compressor.py +++ b/ethosu/vela/weight_compressor.py @@ -416,13 +416,13 @@ def calc_scales_and_pack_biases(tens, arch, ofm_depth_step, rescale_for_faf=Fals first_consumer_op = tens.consumer_list[0] ifm_dtype = first_consumer_op.inputs[0].dtype ifm_scale = first_consumer_op.inputs[0].quantization.scale_f32 - ofm_scale = first_consumer_op.outputs[0].quantization.scale_f32 + ofm_scale = first_consumer_op.get_output_quantization().scale_f32 weight_scales = first_consumer_op.inputs[1].quantization.scale_f32 # biases can have multiple consumers for rnn cells. if so, then check that they are all the same for op in tens.consumer_list[1:]: assert ifm_scale == op.inputs[0].quantization.scale_f32 - assert ofm_scale == op.outputs[0].quantization.scale_f32 + assert ofm_scale == op.get_output_quantization().scale_f32 assert weight_scales == op.inputs[1].quantization.scale_f32 if not hasattr(weight_scales, "__iter__"): |