tf.compat.v1.norm

View source on GitHub

Computes the norm of vectors, matrices, and tensors. (deprecated arguments)

tf.compat.v1.norm(
    tensor, ord='euclidean', axis=None, keepdims=None, name=None, keep_dims=None
)

Warning: SOME ARGUMENTS ARE DEPRECATED: (keep_dims). They will be removed in a future version. Instructions for updating: keep_dims is deprecated, use keepdims instead

This function can compute several different vector norms (the 1-norm, the Euclidean or 2-norm, the inf-norm, and in general the p-norm for p > 0) and matrix norms (Frobenius, 1-norm, 2-norm and inf-norm).

Args:

Returns:

Raises:

Numpy Compatibility

Mostly equivalent to numpy.linalg.norm. Not supported: ord <= 0, 2-norm for matrices, nuclear norm. Other differences: a) If axis is None, treats the flattened tensor as a vector regardless of rank. b) Explicitly supports 'euclidean' norm as the default, including for higher order tensors.