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 firstIntTuple
to compare. - b (
IntTuple[origin]
): The secondIntTuple
to compare.
Returns:
True if shape A is weakly compatible with shape B, False otherwise.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!