Mojo function
compatible
compatible(a: IntTuple[origin], b: IntTuple[origin]) -> Bool
Test if two shapes are compatible for tensor operations.
This function checks if shape A is compatible with shape B, meaning:
- The total size of A and B are the same
- Any coordinate into A can also be used as a coordinate into B
Compatible can also be thought of as a partial order on A and B: A <= B.
Args:
- a (
IntTuple[origin]
): The firstIntTuple
to compare. - b (
IntTuple[origin]
): The secondIntTuple
to compare.
Returns:
True if shape A is 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!