Class StructuralEqual#

Class Documentation#

class StructuralEqual#

Structural equality comparators.

Public Static Functions

static bool Equal(const Any &lhs, const Any &rhs, bool map_free_vars = false, bool skip_tensor_content = false)#

Compare two Any values for structural equality.

Parameters:
  • lhs – The left hand side Any object.

  • rhs – The right hand side Any object.

  • map_free_vars – Whether to map free variables.

  • skip_tensor_content – Whether to skip comparingn darray data content, useful for cases where we don’t care about parameters content

Returns:

True if the two Any values are structurally equal, false otherwise.

static Optional<reflection::AccessPathPair> GetFirstMismatch(const Any &lhs, const Any &rhs, bool map_free_vars = false, bool skip_tensor_content = false)#

Get the first mismatch AccessPath pair when running structural equal comparison between two Any values.

Parameters:
  • lhs – The left hand side Any object.

  • rhs – The right hand side Any object.

  • map_free_vars – Whether to map free variables.

  • skip_tensor_content – Whether to skip comparing tensor data content, useful for cases where we don’t care about parameters content

Returns:

If comparison fails, return the first mismatch AccessPath pair, otherwise return std::nullopt.