Skip to content
Snippets Groups Projects
Commit bdce7541 authored by Hendrik Borras's avatar Hendrik Borras
Browse files

Fixed a potential bug where removing the FINN datatype on a tensor would also...

Fixed a potential bug where removing the FINN datatype on a tensor would also remove other quantization information.
parent 12ea8977
No related branches found
No related tags found
No related merge requests found
......@@ -346,7 +346,12 @@ class QuantActBaseHandler(ABC):
# Unset the FINN datatype
qnt_annotations = model._model_proto.graph.quantization_annotation
ret = get_by_name(qnt_annotations, n.output[0], "tensor_name")
ret.Clear()
if ret is not None:
ret_dt = get_by_name(
ret.quant_parameter_tensor_names, "finn_datatype", "key"
)
if ret_dt is not None:
ret_dt.Clear()
# ToDo: This should be supported by finn-base, by calling the following:
# model.set_tensor_datatype(n.output[0], None)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment