def _gm(x):
    """Returns the geometric means of the rows in `x`.

    Parameters
    ----------
    x : NumPy array, shape (k,n)
        The k compositions whose geometric means are to be computed.

    Returns
    -------
    x_gm : NumPy array, shape (k,)
        The geometric means for the k compositions in `x`.

    """
    last_axis = -1
    x_gm = x.prod(axis=last_axis) ** (1 / x.shape[last_axis])
    return x_gm
