Einsum-pattern parsing #
This module parses comma-separated operands, the output expression, and their canonical rendering round trip. Empty operand expressions represent scalar tensors; leading, adjacent, and trailing commas therefore preserve empty operands. Dimension compatibility and supported axis forms belong to the einsum checker.
Parse comma-separated einsum operands in source order.
Instances For
Parse an einsum pattern with one or more comma-separated input expressions.
Instances For
Parsing a successful einsum pattern's canonical rendering succeeds with the same canonical syntax.
The theorem applies to any number of input tensors. It preserves their order and comma boundaries, including empty expressions denoting scalar operands. Repeated labels and ellipses inside inputs are retained; only source locations and anonymous-axis occurrence offsets are intentionally refreshed.