Skip to content

Commit 6979325

Browse files
yifan.chencharlesxzb
authored andcommitted
fix: remove_cast bug
- 1. find CastOp need to be removed - 2. fix bypass except CastOps removed Change-Id: If5cae76124cbc3d454260e7ca5175ad8e7736d19
1 parent 365d710 commit 6979325

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

python/transform/OnnxOpt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ def insert_identity(cur_node_out, out_name):
973973
for node in self.nodes:
974974
if node.op_type == "Constant":
975975
continue
976-
if node.op_type == "Cast":
976+
if node.op_type == "Cast" and node in cast_ops:
977977
continue
978978
for i in range(len(node.input)):
979979
if node.input[i] in cast_in_dict:

0 commit comments

Comments
 (0)