MCPcopy Create free account
hub / github.com/apache/tvm / expr_deep_equal

Function expr_deep_equal

python/tvm/tirx/analysis/analysis.py:30–64  ·  view source on GitHub ↗

Deeply compare two nested expressions. Parameters ---------- lhs : PrimExpr The left operand. rhs : PrimExpr The right operand. Returns ------- result : bool The comparison result Note ---- This function does not remap variable bin

(lhs: PrimExpr, rhs: PrimExpr)

Source from the content-addressed store, hash-verified

28
29
30def expr_deep_equal(lhs: PrimExpr, rhs: PrimExpr) -> bool:
31 """Deeply compare two nested expressions.
32
33 Parameters
34 ----------
35 lhs : PrimExpr
36 The left operand.
37
38 rhs : PrimExpr
39 The right operand.
40
41 Returns
42 -------
43 result : bool
44 The comparison result
45
46 Note
47 ----
48
49 This function does not remap variable bindings, it will not
50 return true for (let x = 1 in x + 1) vs (let y = 1 in y + 1), unless x.same_as(y).
51 Use py:func:`tvm_ffi.structural_equal` to handle structural variable remapping.
52
53 Due to the restriction of not remapping variables, this function can run
54 faster than StructuralEqual and can be used as a utility function during arithmetic
55 simplifications.
56
57 Always consider py:func:`tvm_ffi.structural_equal` first, which handles
58 the structural remapping.
59
60 See Also
61 --------
62 tvm_ffi.structural_equal
63 """
64 return _ffi_api.expr_deep_equal(lhs, rhs) # type: ignore
65
66
67def verify_ssa(func: PrimFunc) -> bool:

Callers 1

test_expr_constructorFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_expr_constructorFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…