Gets the shape (dimensions) of a matrix as [rows, columns]
The matrix to measure
If true, validates that all rows have the same number of columns (default: false)
A tuple containing [number of rows, number of columns]
Error if check is true and rows have inconsistent lengths
Gets the shape (dimensions) of a matrix as [rows, columns]