(self)
Returns a list with dimensions of each index.

        Dimensions is a property of the array, not of the indices.  Still, if
        the IndexedBase does not define a shape attribute, it is assumed that
        the ranges of the indices correspond to the shape of the array.

        >>> from sympy.tensor.indexed import IndexedBase, Idx
        >>> from sympy import symbols
        >>> n, m = symbols('n m', integer=True)
        >>> i = Idx('i', m)
        >>> j = Idx('j', m)
        >>> A = IndexedBase('A', shape=(n, n))
        >>> B = IndexedBase('B')
        >>> A[i, j].shape
        (n, n)
        >>> B[i, j].shape
        (m, m)
Returns a list with dimensions of each index.
Returns a list with dimensions of each index .
def shape(self):
        """Returns a list with dimensions of each index.

        Dimensions is a property of the array, not of the indices.  Still, if
        the IndexedBase does not define a shape attribute, it is assumed that
        the ranges of the indices correspond to the shape of the array.

        >>> from sympy.tensor.indexed import IndexedBase, Idx
        >>> from sympy import symbols
        >>> n, m = symbols('n m', integer=True)
        >>> i = Idx('i', m)
        >>> j = Idx('j', m)
        >>> A = IndexedBase('A', shape=(n, n))
        >>> B = IndexedBase('B')
        >>> A[i, j].shape
        (n, n)
        >>> B[i, j].shape
        (m, m)
        """
        from sympy.utilities.misc import filldedent

        if self.base.shape:
            return self.base.shape
        try:
            return Tuple(*[i.upper - i.lower + 1 for i in self.indices])
        except AttributeError:
            raise IndexException(filldedent("""
                Range is not defined for all indices in: %s""" % self))
        except TypeError:
            raise IndexException(filldedent("""
                Shape cannot be inferred from Idx with
                undefined range: %s""" % self))
def shape ( self ) : from sympy . utilities . misc import filldedent if self . base . shape : return self . base . shape try : return Tuple ( * [ i . upper - i . lower + 1 for i in self . indices ] ) except AttributeError : raise IndexException ( filldedent ( """
                Range is not defined for all indices in: %s""" % self ) ) except TypeError : raise IndexException ( filldedent ( """
                Shape cannot be inferred from Idx with
                undefined range: %s""" % self ) )