teras.ops.norm

Contents

teras.ops.norm#

teras.ops.norm(x, ord=None, axis=None, keepdims=False)[source]#

Matrix or vector norm.

Parameters:
  • x (KerasTensor) – Input tensor.

  • ord (str) – Order of norm.

  • axis (int) – If axis is an integer, it specifies the axis of x along which to compute the vector norms. If axis is a 2-tuple, it specifies the axes that hold 2-D matrices, and the matrix norms of these matrices are computed. If axis is None then either a vector norm (when x is 1-D) or a matrix norm (when x is 2-D) is returned. The default is None.

  • keepdims (bool) – If this is set to True, the axes which are normed over are left in the result as dimensions with size one. With this option the result will broadcast correctly against the original x.

Returns:

Norm of the matrix or vector(s).