valid_index()
Get a valid index for a broadcastable shape.
index (tuple) – Given index.
shape (tuple of int) – Shape.
Valid index.
tuple