Python wrappers
Public Python APIs implemented by this engine symbol.Compute the p-norm of a float tensor over the specified axes.
Math
For on a matrix this is the Frobenius norm; for on a matrix this is the entrywise L1 norm (not the operator 1-norm).
Shape
a: arbitrary float shape.- Output:
axisempty,keepdims=falsescalar (rank 0).axisempty,keepdims=trueall-ones shape of the same rank asa.- Otherwise: rank of
aminus the number of reduced axes (keepdims=false) or rank preserved with those axes set to 1 (keepdims=true).
See Also
SVD.h : Underpins operator norms (spectral, nuclear) once exposed.
Parameters
aTensorImplPtrInput tensor (any float dtype, any shape).
orddoubleNorm order.
2.0 selects the Frobenius / Euclidean norm ; 1.0 selects the entrywise L1 norm . Other values may be forwarded to the backend in the forward pass but have no registered backward.axisstd::vector<int>Axes to reduce. Empty means a global reduction over every element; negative indices are accepted and normalised.
keepdimsboolIf
true the reduced axes are retained as size-1 stubs in the output; otherwise they are removed.Returns
TensorImplPtrReduced norm tensor.
Raises
ValueErrorIf
a is non-float.NotImplementedError(At backward time.) If
ord is not 1.0 or 2.0 and a gradient is requested.Notes
Operator norms (spectral, nuclear, induced 1-/inf-norm) are not yet dispatched here — they would require SVD and a separate backward. This op currently covers only the entrywise reductions.