def METHOD_NAME(self, scales):
    """Cached grid shape computation."""
    shape = np.ones(self.dist.dim, dtype=int)
    for basis in self.bases:
        subscales = scales[basis.axis:basis.axis+basis.dim]
        subshape = basis.grid_shape(subscales)
        shape[basis.axis:basis.axis+basis.dim] = subshape
    return tuple(shape)