as_shape

probnum.utils.as_shape(x, ndim=None)[source]

Convert a shape representation into a shape defined as a tuple of ints.

Parameters
Raises
  • TypeError – If x is not a valid ShapeLike.

  • TypeError – If x does not feature the required number of dimensions.

Return type

Tuple[int, …]