tvm_tirx.ir.prim.expr_deep_equal

tvm_tirx.ir.prim.expr_deep_equal#

tvm_tirx.ir.prim.expr_deep_equal(lhs, rhs)#

Deeply compare two nested expressions.

Parameters:
  • lhs (Expr) – The left operand.

  • rhs (Expr) – The right operand.

Returns:

result (bool) – The comparison result

Return type:

bool

Note

This function does not remap variable bindings, it will not return true for (let x = 1 in x + 1) vs (let y = 1 in y + 1), unless x.same_as(y). Use py:func:tvm_ffi.structural_equal to handle structural variable remapping.

Due to the restriction of not remapping variables, this function can run faster than StructuralEqual and can be used as a utility function during arithmetic simplifications.

Always consider py:func:tvm_ffi.structural_equal first, which handles the structural remapping.