def norm(x, p: int):
    """
    Compute p-norm across the features of a batch of instances.
    Parameters
    ----------
    x
        Batch of instances of shape [N, features].
    p
        Power of the norm.
    Returns
    -------
    Array where p-norm is applied to the features.
    """
    return (x ** p).sum(axis=1)