bayespy.utils.misc.safe_indices

bayespy.utils.misc.safe_indices(inds, shape)[source]

Makes sure that indices are valid for given shape.

The shorter shape determines the length.

For instance,

>>> safe_indices( (3, 4, 5), (1, 6) )
(0, 5)