Skip to content

Commit

Permalink
Fix ITEX Quantize/ Dequantize before BN u8 issue (#931)
Browse files Browse the repository at this point in the history
Signed-off-by: Lv, Liang1 <[email protected]>
  • Loading branch information
lvliang-intel authored Jun 2, 2023
1 parent 7e4bef1 commit 5519e2c
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,10 @@ def _find_relu_node(self, node):
input1_node = self.node_name_mapping[node.input[1].rsplit(':', 1)[0]].node
else:
input1_node = self.node_name_mapping[node.input[1]].node
if input0_node.op in ("AvgPool", "MaxPool"):
return self._find_relu_node(input0_node)
if input1_node.op in ("AvgPool", "MaxPool"):
return self._find_relu_node(input1_node)
if input1_node.op in ('BiasAdd', 'Add', 'AddV2', 'AddN'):
if input0_node.op in ('BiasAdd', 'Add', 'AddV2', 'AddN') or \
input1_node.op in ('BiasAdd', 'Add', 'AddV2', 'AddN'):
return False
return self._find_relu_node(input1_node)
return self._find_relu_node(input0_node) and self._find_relu_node(input1_node)
elif self._check_op_list(node.op) or (self.itex_mode and node.op in ('Add', 'AddV2')):
if node.op == 'ConcatV2':
find_relu = False
Expand Down

0 comments on commit 5519e2c

Please sign in to comment.