@@ -560,6 +560,29 @@ def _dims_from_tuple_indexing(dims: _Dims, key: _IndexKeysDims) -> _Dims:
560560 raise NotImplementedError (
561561 f"What happens here? { key_no_ellipsis = } , { dims = } , { i = } , { k = } "
562562 )
563+ # If T contains at least one non-zero-dimensional integer array,
564+ # all elements of T must be broadcast against each other to determine
565+ # a common shape S2 = (s1, s2, ..., sN) according to standard
566+ # broadcasting rules (see Broadcasting). If one or more elements in T
567+ # are not broadcast-compatible with the others, an exception must be
568+ # raised.
569+
570+ # After broadcasting elements of T to a common shape S2, the resulting
571+ # tuple U = (u1, u2, ..., uN) must only contain integer arrays having
572+ # shape S2 (i.e.,
573+ # u1 = broadcast_to(t1, S2),
574+ # u2 = broadcast_to(t2, S2), et cetera).
575+
576+ # Each element in U must specify a multi-dimensional index
577+ # v_i = (u1[i], u2[i], ..., uN[i]), where i ranges over S2. The result
578+ # of A[U] must be constructed by gathering elements from A at each
579+ # coordinate tuple v_i. For example, let A have shape (4,4) and U
580+ # contain integer arrays equivalent to ([0,1], [2,3]), with u1 = [0,1]
581+ # and u2 = [2,3]. The resulting coordinate tuples must be (0,2) and
582+ # (1,3), respectively, and the resulting array must have shape (2,)
583+ # and contain elements A[(0,2)] and A[(1,3)].
584+
585+ # The result of A[U] must be an array having the broadcasted shape S2.
563586
564587 return tuple (new_dims )
565588
0 commit comments