IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo function

weakly_compatible

def weakly_compatible(a: IntTuple, b: IntTuple) -> 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): The first IntTuple to compare.
  • b (IntTuple): The second IntTuple to compare.

Returns:

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

Was this page helpful?