Skip to content

Commit

Permalink
Merge pull request #1130 from fastmachinelearning/result_t_bug_fix
Browse files Browse the repository at this point in the history
remove incorrect setting of result_t
  • Loading branch information
bo3z authored Nov 17, 2024
2 parents 51cb83c + 18fc2b8 commit e778ed3
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion hls4ml/model/optimizer/passes/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def transform(self, model, node):
# if the activation has a quantizer (usually from a QONNX Quant node), set the previous node's output precision
if quantizer is not None:
prev_node.set_attr("quantizer", quantizer)
prev_node.types['result_t'] = quantizer.hls_type
prev_node.get_output_variable().type.precision = quantizer.hls_type
model.remove_node(node)
return True
1 change: 0 additions & 1 deletion hls4ml/model/optimizer/passes/merge_const.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def transform(self, model, node):
const_node0.set_attr('quantizer', quantizer) # overwrite the quantizer
if quantizer:
const_node0.set_attr('quantizer', quantizer)
const_node0.types['result_t'] = quantizer.hls_type
const_node0.get_output_variable().type.precision = quantizer.hls_type
const_node0.set_attr('value', new_val)

Expand Down
2 changes: 0 additions & 2 deletions hls4ml/model/optimizer/passes/quant_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ def transform(self, model, node):

const_node = node.get_input_node(node.inputs[0])
const_node.set_attr('quantizer', quantizer)
const_node.set_attr('result_t', precision)
const_node.get_output_variable().type.precision = precision

# Should we update the configuration to reflect the new precision? I don't think it's necessary
Expand Down Expand Up @@ -331,7 +330,6 @@ def transform(self, model, node):
const_node.set_attr('value', new_val)
const_node.set_attr('quantizer', quantizer)

const_node.types['result_t'].precision = precision
const_node.get_output_variable().type.precision = precision

inshape = node.get_input_variable().shape
Expand Down

0 comments on commit e778ed3

Please sign in to comment.