Skip to content

Commit

Permalink
Update Conditions of Getting min-max during TF MatMul Requantize (#1660)
Browse files Browse the repository at this point in the history
Signed-off-by: zehao-intel <[email protected]>
  • Loading branch information
zehao-intel authored Mar 12, 2024
1 parent c214f90 commit d07175c
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,14 @@ def do_transformation(self):

weight_node = self.graph_info[new_node.input[1]].node
bias_node = self.graph_info[new_node.input[2]].node
max_input_node = self.graph_info[last_node.input[-1]].node
min_input_node = self.graph_info[last_node.input[-2]].node

if max_input_node.op == "Enter": # pragma: no cover
max_input_node = None
min_input_node = None
if last_node.op.find("Requantize") != -1 or last_node.op.find("QuantizeV2") != -1:
max_input_node = self.graph_info[last_node.input[-1]].node
min_input_node = self.graph_info[last_node.input[-2]].node

if max_input_node and max_input_node.op == "Enter": # pragma: no cover
min_input_parent_name = Helper.node_name_from_input(min_input_node.input[0])
max_input_parent_name = Helper.node_name_from_input(max_input_node.input[0])
min_input_parent_node = self.graph_info[min_input_parent_name].node
Expand Down

0 comments on commit d07175c

Please sign in to comment.