mr2.utils.broadcast_shapes_except
- mr2.utils.broadcast_shapes_except(shapes: Sequence[Sequence[int]], dim: int) list[tuple[int, ...]][source]
Broadcast shapes against each other, except along one dimension.
Inputs are first left-padded with ones to a common number of dimensions (matching PyTorch right-aligned broadcasting). All dimensions except
dimare then broadcast normally. Each output shape keeps its input’s original size alongdim.