IdentityEliminationPass¶
- class onnx_ir.passes.common.IdentityEliminationPass[source]¶
Pass for eliminating redundant Identity nodes.
This pass removes Identity nodes according to the following rules:
For any node of the form y = Identity(x), where y is not an output of any graph, replace all uses of y with a use of x, and remove the node.
If y is an output of a graph, and x is not an input of any graph, we can still do the elimination, but the value x should be renamed to be y.
If y is a graph-output and x is a graph-input, we cannot eliminate the node. It should be retained.