From 73fb1a4db4ffb75c856a14e667665c2ce9e386d2 Mon Sep 17 00:00:00 2001 From: Jan Iwaszkiewicz Date: Fri, 6 Sep 2024 15:00:55 +0200 Subject: [PATCH] [one-cmds] Add an option for RemoveUnnecessaryCastPass (#13897) This commit adds one-cmd option for RemoveUnnecessaryCastPass. ONE-DCO-1.0-Signed-off-by: Jan Iwaszkiewicz --- compiler/one-cmds/how-to-use-one-commands.txt | 1 + compiler/one-cmds/onelib/constant.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/compiler/one-cmds/how-to-use-one-commands.txt b/compiler/one-cmds/how-to-use-one-commands.txt index d6656545ff8..817b0c76ebc 100644 --- a/compiler/one-cmds/how-to-use-one-commands.txt +++ b/compiler/one-cmds/how-to-use-one-commands.txt @@ -200,6 +200,7 @@ Current transformation options are - remove_redundant_reshape : This fuses or removes redundant reshape operators. - remove_redundant_transpose : This fuses or removes redundant transpose operators. - remove_unnecessary_add : This removes unnecessary add operators. +- remove_unnecessary_cast : This will remove unnecessary cast with the same input and output type. - remove_unnecessary_reshape : This removes unnecessary reshape operators. - remove_unnecessary_slice : This removes unnecessary slice operators. - remove_unnecessary_strided_slice : This removes unnecessary strided slice operators. diff --git a/compiler/one-cmds/onelib/constant.py b/compiler/one-cmds/onelib/constant.py index a8dabf139d0..97b207488f3 100644 --- a/compiler/one-cmds/onelib/constant.py +++ b/compiler/one-cmds/onelib/constant.py @@ -63,6 +63,7 @@ class CONSTANT: 'remove_redundant_reshape', 'remove_redundant_transpose', 'remove_unnecessary_add', + 'remove_unnecessary_cast' 'remove_unnecessary_reshape', 'remove_unnecessary_slice', 'remove_unnecessary_strided_slice', @@ -157,6 +158,7 @@ class CONSTANT: ('remove_redundant_reshape', 'fuse or remove subsequent Reshape ops'), ('remove_redundant_transpose', 'fuse or remove subsequent Transpose ops'), ('remove_unnecessary_add', 'remove unnecessary add ops'), + ('remove_unnecessary_cast', 'remove unnecessary cast ops'), ('remove_unnecessary_reshape', 'remove unnecessary reshape ops'), ('remove_unnecessary_slice', 'remove unnecessary slice ops'), ('remove_unnecessary_strided_slice', 'remove unnecessary strided slice ops'),