tvm_ffi.get_first_structural_mismatch

tvm_ffi.get_first_structural_mismatch#

tvm_ffi.get_first_structural_mismatch(lhs, rhs, map_free_vars=False, skip_tensor_content=False)[source]#

Like structural_equal(), but returns the AccessPath pair of the first detected mismatch.

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

  • rhs (Any) – The right operand.

  • map_free_vars (bool, default: False) – Whether free variables (i.e. variables without a definition site) should be mapped as equal to each other.

  • skip_tensor_content (bool, default: False) – Whether to skip the data content of tensor.

Return type:

tuple[AccessPath, AccessPath] | None

Returns:

mismatch (tuple[AccessPath, AccessPath] | None) – None if lhs and rhs are structurally equal. Otherwise, a tuple of two AccessPath objects that point to the first detected mismatch.