Skip to main content
Log in

Mojo function

weakly_compatible

weakly_compatible(a: IntTuple[origin], b: IntTuple[origin]) -> Bool

Test if shape A is weakly compatible with shape B.

A shape A is weakly compatible with shape B if there exists a shape C congruent to A such that compatible(elem_scale(A,C), B). This establishes a partial order relation between shapes where A <= B.

Specifically, this checks if the size of B is divisible by the size of A, which is a necessary condition for weak compatibility.

Args:

  • a (IntTuple[origin]): The first IntTuple to compare.
  • b (IntTuple[origin]): The second IntTuple to compare.

Returns:

True if shape A is weakly compatible with shape B, False otherwise.