TensorPrimitives.Norm Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Norm(ReadOnlySpan<Single>) |
Computes the Euclidean norm of the specified tensor of single-precision floating-point numbers. |
Norm<T>(ReadOnlySpan<T>) |
Computes the Euclidean norm of the specified tensor of numbers. |
Norm(ReadOnlySpan<Single>)
- Source:
- TensorPrimitives.cs
- Source:
- TensorPrimitives.Single.cs
Computes the Euclidean norm of the specified tensor of single-precision floating-point numbers.
public:
static float Norm(ReadOnlySpan<float> x);
public static float Norm (ReadOnlySpan<float> x);
static member Norm : ReadOnlySpan<single> -> single
Public Shared Function Norm (x As ReadOnlySpan(Of Single)) As Single
Parameters
The first tensor, represented as a span.
Returns
The norm.
Remarks
This method effectively computes MathF.Sqrt(TensorPrimitives.SumOfSquares(x))
. This is often referred to as the Euclidean norm or L2 norm. It corresponds to the nrm2
method defined by BLAS1
.
If any of the input values is equal to NaN, the result value is also NaN.
This method may call into the underlying C runtime or employ instructions specific to the current architecture. Exact results may differ between different operating systems or architectures.
Applies to
Norm<T>(ReadOnlySpan<T>)
- Source:
- TensorPrimitives.Norm.cs
Computes the Euclidean norm of the specified tensor of numbers.
public:
generic <typename T>
where T : System::Numerics::IRootFunctions<T> static T Norm(ReadOnlySpan<T> x);
public static T Norm<T> (ReadOnlySpan<T> x) where T : System.Numerics.IRootFunctions<T>;
static member Norm : ReadOnlySpan<'T (requires 'T :> System.Numerics.IRootFunctions<'T>)> -> 'T (requires 'T :> System.Numerics.IRootFunctions<'T>)
Public Shared Function Norm(Of T As IRootFunctions(Of T)) (x As ReadOnlySpan(Of T)) As T
Type Parameters
- T
Parameters
The first tensor, represented as a span.
Returns
The norm.
Remarks
This method effectively computes
. This is often referred to as the Euclidean norm or L2 norm. It corresponds to the T
.Sqrt(TensorPrimitives.SumOfSquares(x))nrm2
method defined by BLAS1
.
If any of the input values is equal to NaN, the result value is also NaN.
This method may call into the underlying C runtime or employ instructions specific to the current architecture. Exact results may differ between different operating systems or architectures.