parameters: (self)
docstring: Returns `self.dims` if the rank is known, otherwise raises ValueError.
docstring_summary: Returns `self.dims` if the rank is known, otherwise raises ValueError.
docstring_tokens: Returns self . dims if the rank is known otherwise raises ValueError .
function: def __iter__(self):
      """Returns `self.dims` if the rank is known, otherwise raises ValueError."""
      if self._dims is None:
        raise ValueError("Cannot iterate over a shape with unknown rank.")
      else:
        return iter(self._dims)
function_tokens: def __iter__ ( self ) : if self . _dims is None : raise ValueError ( "Cannot iterate over a shape with unknown rank." ) else : return iter ( self . _dims )