(vec)
return np.sqrt(result)
Compute the (standard l2) norm of a vector.

    Parameters
    ----------
    vec: array of shape (dim,)

    Returns
    -------
    The l2 norm of vec.
Compute the (standard l2) norm of a vector.
Compute the ( standard l2 ) norm of a vector .
def norm(vec):
    """Compute the (standard l2) norm of a vector.

    Parameters
    ----------
    vec: array of shape (dim,)

    Returns
    -------
    The l2 norm of vec.
    """
    result = 0.0
    for i in range(vec.shape[0]):
        result += vec[i] ** 2
    return np.sqrt(result)
def norm ( vec ) : result = 0.0 for i in range ( vec . shape [ 0 ] ) : result += vec [ i ] ** 2 return np . sqrt ( result )