Checks that all arrays have the same size. Args: inputs: A collection of arrays. Raises: AssertionError: If the size of all arrays do not match.
(inputs: Sequence[Array])
| 369 | |
| 370 | @_static_assertion |
| 371 | def assert_equal_size(inputs: Sequence[Array]) -> None: |
| 372 | """Checks that all arrays have the same size. |
| 373 | |
| 374 | Args: |
| 375 | inputs: A collection of arrays. |
| 376 | |
| 377 | Raises: |
| 378 | AssertionError: If the size of all arrays do not match. |
| 379 | """ |
| 380 | _ai.assert_collection_of_arrays(inputs) |
| 381 | size = inputs[0].size |
| 382 | expected_sizes = [size] * len(inputs) |
| 383 | sizes = [x.size for x in inputs] |
| 384 | if sizes != expected_sizes: |
| 385 | raise AssertionError(f"Arrays have different sizes: {sizes}") |
| 386 | |
| 387 | |
| 388 | @_static_assertion |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…