API Reference
as_shape()
Convert a shape representation into a shape defined as a tuple of ints.
x (int | Integral | integer | Iterable[int | Integral | integer]) – Shape representation.
ndim (Integral | None) – The required number of dimensions in the shape.
TypeError – If x is not a valid ShapeLike.
x
ShapeLike
TypeError – If x does not feature the required number of dimensions.
Tuple[int, …]