(
matrix_a: list[list[int]], matrix_b: list[list[int]]
)
| 171 | |
| 172 | |
| 173 | def _verify_matrix_sizes( |
| 174 | matrix_a: list[list[int]], matrix_b: list[list[int]] |
| 175 | ) -> tuple[tuple[int, int], tuple[int, int]]: |
| 176 | shape = _shape(matrix_a) + _shape(matrix_b) |
| 177 | if shape[0] != shape[3] or shape[1] != shape[2]: |
| 178 | msg = ( |
| 179 | "operands could not be broadcast together with shape " |
| 180 | f"({shape[0], shape[1]}), ({shape[2], shape[3]})" |
| 181 | ) |
| 182 | raise ValueError(msg) |
| 183 | return (shape[0], shape[2]), (shape[1], shape[3]) |
| 184 | |
| 185 | |
| 186 | def main() -> None: |